Loading src/Services/MoveFileService.php +1 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ class MoveFileService { // The file should be moved only if the target URI is different from // the recent URI. if ($file_target_uri != $file->getFileUri()) { if (file_move($file, $file_target_uri)) { if (\Drupal::service('file.repository')->move($file, $file_target_uri)) { $this->logger->notice('The file "' . $file->getFilename() . '" has been moved to the path: ' . $file_target_uri); } else { Loading src/Tests/Form/MoveFileContentTypesFormTest.php +3 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -82,7 +82,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); $this->guestRole = Role::load('anonymous'); Loading Loading @@ -143,10 +143,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase { 'settings[article][vocabulary_field]' => 'field_tags', 'settings[article][file_field][field_image]' => 'field_image', ]; $this->drupalPostForm(NULL, $edit, t('Save configuration') ); $this->submitForm($edit, t('Save configuration')); $this->assertSession()->pageTextContains( 'The configuration options have been saved.' Loading src/Tests/Form/MoveFileCreateConfigEntityTest.php +3 −6 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -90,7 +90,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); $this->guestRole = Role::load('anonymous'); Loading Loading @@ -195,10 +195,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase { 'id' => '_aaa', 'term_id' => $this->term->id(), ]; $this->drupalPostForm(NULL, $edit, t('Save') ); $this->submitForm($edit, t('Save')); $this->assertSession()->pageTextContains( 'The directory /aaa was saved successfully.' Loading src/Tests/Form/MoveFileSettingsFormTest.php +3 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -82,7 +82,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); $this->guestRole = Role::load('anonymous'); Loading Loading @@ -126,10 +126,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase { $edit = [ 'move_file_vocabulary' => 'tags', ]; $this->drupalPostForm(NULL, $edit, t('Save configuration') ); $this->submitForm($edit, t('Save configuration')); $this->assertSession()->pageTextContains( 'The configuration options have been saved.' Loading src/Tests/MoveFileComplexTest.php +4 −10 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class MoveFileComplexTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -93,7 +93,7 @@ class MoveFileComplexTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); // Set up our custom test config. Loading Loading @@ -178,10 +178,7 @@ class MoveFileComplexTest extends BrowserTestBase { 'id' => '_aaa', 'term_id' => $this->termA->id(), ]; $this->drupalPostForm(NULL, $edit, t('Save') ); $this->submitForm($edit, t('Save')); $this->assertSession()->pageTextContains( 'The directory /aaa was saved successfully.' ); Loading @@ -192,10 +189,7 @@ class MoveFileComplexTest extends BrowserTestBase { 'id' => '_bbb', 'term_id' => $this->termB->id(), ]; $this->drupalPostForm(NULL, $edit, t('Save') ); $this->submitForm($edit, t('Save')); $this->assertSession()->pageTextContains( 'The directory /bbb was saved successfully.' ); Loading Loading
src/Services/MoveFileService.php +1 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ class MoveFileService { // The file should be moved only if the target URI is different from // the recent URI. if ($file_target_uri != $file->getFileUri()) { if (file_move($file, $file_target_uri)) { if (\Drupal::service('file.repository')->move($file, $file_target_uri)) { $this->logger->notice('The file "' . $file->getFilename() . '" has been moved to the path: ' . $file_target_uri); } else { Loading
src/Tests/Form/MoveFileContentTypesFormTest.php +3 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -82,7 +82,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); $this->guestRole = Role::load('anonymous'); Loading Loading @@ -143,10 +143,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase { 'settings[article][vocabulary_field]' => 'field_tags', 'settings[article][file_field][field_image]' => 'field_image', ]; $this->drupalPostForm(NULL, $edit, t('Save configuration') ); $this->submitForm($edit, t('Save configuration')); $this->assertSession()->pageTextContains( 'The configuration options have been saved.' Loading
src/Tests/Form/MoveFileCreateConfigEntityTest.php +3 −6 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -90,7 +90,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); $this->guestRole = Role::load('anonymous'); Loading Loading @@ -195,10 +195,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase { 'id' => '_aaa', 'term_id' => $this->term->id(), ]; $this->drupalPostForm(NULL, $edit, t('Save') ); $this->submitForm($edit, t('Save')); $this->assertSession()->pageTextContains( 'The directory /aaa was saved successfully.' Loading
src/Tests/Form/MoveFileSettingsFormTest.php +3 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -82,7 +82,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); $this->guestRole = Role::load('anonymous'); Loading Loading @@ -126,10 +126,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase { $edit = [ 'move_file_vocabulary' => 'tags', ]; $this->drupalPostForm(NULL, $edit, t('Save configuration') ); $this->submitForm($edit, t('Save configuration')); $this->assertSession()->pageTextContains( 'The configuration options have been saved.' Loading
src/Tests/MoveFileComplexTest.php +4 −10 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class MoveFileComplexTest extends BrowserTestBase { * * @var array */ public static $modules = ['move_file']; protected static $modules = ['move_file']; /** * Default theme. Loading Loading @@ -93,7 +93,7 @@ class MoveFileComplexTest extends BrowserTestBase { * * @throws \Drupal\Core\Entity\EntityStorageException */ public function setUp() { public function setUp(): void { parent::setUp(); // Set up our custom test config. Loading Loading @@ -178,10 +178,7 @@ class MoveFileComplexTest extends BrowserTestBase { 'id' => '_aaa', 'term_id' => $this->termA->id(), ]; $this->drupalPostForm(NULL, $edit, t('Save') ); $this->submitForm($edit, t('Save')); $this->assertSession()->pageTextContains( 'The directory /aaa was saved successfully.' ); Loading @@ -192,10 +189,7 @@ class MoveFileComplexTest extends BrowserTestBase { 'id' => '_bbb', 'term_id' => $this->termB->id(), ]; $this->drupalPostForm(NULL, $edit, t('Save') ); $this->submitForm($edit, t('Save')); $this->assertSession()->pageTextContains( 'The directory /bbb was saved successfully.' ); Loading