Commit 5034216c authored by Antonín Slejška's avatar Antonín Slejška
Browse files

Issue #3297704 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent eb0900b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+3 −6
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class MoveFileContentTypesFormTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['move_file'];
  protected static $modules = ['move_file'];

  /**
   * Default theme.
@@ -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');
@@ -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.'
+3 −6
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ class MoveFileCreateConfigEntityTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['move_file'];
  protected static $modules = ['move_file'];

  /**
   * Default theme.
@@ -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');
@@ -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.'
+3 −6
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class MoveFileSettingsFormTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['move_file'];
  protected static $modules = ['move_file'];

  /**
   * Default theme.
@@ -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');
@@ -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.'
+4 −10
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ class MoveFileComplexTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['move_file'];
  protected static $modules = ['move_file'];

  /**
   * Default theme.
@@ -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.
@@ -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.'
    );
@@ -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.'
    );