Verified Commit 62afe776 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3097892 by mondrake, longwave, Berdir: Remove all @deprecated code in test base classes

parent 75df2611
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
namespace Drupal\Tests\file\Functional;

use Drupal\Component\Render\FormattableMarkup;
use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
use Drupal\file\FileInterface;
@@ -11,13 +10,6 @@
use Drupal\file\Entity\File;
use Drupal\Tests\TestFileCreationTrait;

// In order to manage different method signatures between PHPUnit versions, we
// dynamically load a compatibility trait dependent on the PHPUnit runner
// version.
if (!trait_exists(PhpunitVersionDependentFileFieldTestBaseTrait::class, FALSE)) {
  class_alias("Drupal\TestTools\PhpUnitCompatibility\PhpUnit" . RunnerVersion::getMajor() . "\FileFieldTestBaseTrait", PhpunitVersionDependentFileFieldTestBaseTrait::class);
}

/**
 * Provides methods specifically for testing File module's field handling.
 */
@@ -27,7 +19,6 @@ abstract class FileFieldTestBase extends BrowserTestBase {
  use TestFileCreationTrait {
    getTestFiles as drupalGetTestFiles;
  }
  use PhpunitVersionDependentFileFieldTestBaseTrait;

  /**
   * {@inheritdoc}
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ protected function setUp() {
    $this->installSchema('user', 'users_data');
    $this->installSchema('file', 'file_usage');
    $this->installSchema('node', ['node_access']);
    $this->installConfig($this->modules);
    $this->installConfig(static::$modules);

    ConfigurableLanguage::createFromLangcode('fr')->save();

+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public function testMakeRevisionable() {

      // Check that the correct initial value was provided for the
      // 'revision_translation_affected' field.
      $this->assertTrue($revision->revision_translation_affected->value);
      $this->assertTrue((bool) $revision->revision_translation_affected->value);

      $translation = $revision->getTranslation('ro');

+3 −3
Original line number Diff line number Diff line
@@ -55,15 +55,15 @@ public function testWorkspaceAssociationRemoval() {

    // Check that the 'workspace' field has been installed for an entity type
    // that was workspace-supported before Drupal 8.7.0.
    $this->assertTrue($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'node'));
    $this->assertNotEmpty($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'node'));

    // Check that the 'workspace' field has been installed for an entity type
    // which became workspace-supported as part of an entity schema update.
    $this->assertTrue($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'taxonomy_term'));
    $this->assertNotEmpty($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'taxonomy_term'));

    // Check that the 'workspace' field has been installed for an entity type
    // that has been added in an update function.
    $this->assertTrue($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'path_alias'));
    $this->assertNotEmpty($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'path_alias'));

    // Check that the 'workspace' revision metadata field has been created only
    // in the revision table.
+0 −32
Original line number Diff line number Diff line
@@ -113,38 +113,6 @@ protected function getMinkDriverArgs() {
    return parent::getMinkDriverArgs();
  }

  /**
   * Asserts that the element with the given CSS selector is visible.
   *
   * @param string $css_selector
   *   The CSS selector identifying the element to check.
   * @param string $message
   *   Optional message to show alongside the assertion.
   *
   * @deprecated in drupal:8.1.0 and is removed from drupal:9.0.0. Use
   *   \Behat\Mink\Element\NodeElement::isVisible() instead.
   */
  protected function assertElementVisible($css_selector, $message = '') {
    $this->assertTrue($this->getSession()->getDriver()->isVisible($this->cssSelectToXpath($css_selector)), $message);
    @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 8.1.0 and will be removed in 9.0.0. Use \Behat\Mink\Element\NodeElement::isVisible() instead.', E_USER_DEPRECATED);
  }

  /**
   * Asserts that the element with the given CSS selector is not visible.
   *
   * @param string $css_selector
   *   The CSS selector identifying the element to check.
   * @param string $message
   *   Optional message to show alongside the assertion.
   *
   * @deprecated in drupal:8.1.0 and is removed from drupal:9.0.0. Use
   *   \Behat\Mink\Element\NodeElement::isVisible() instead.
   */
  protected function assertElementNotVisible($css_selector, $message = '') {
    $this->assertFalse($this->getSession()->getDriver()->isVisible($this->cssSelectToXpath($css_selector)), $message);
    @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 8.1.0 and will be removed in 9.0.0. Use \Behat\Mink\Element\NodeElement::isVisible() instead.', E_USER_DEPRECATED);
  }

  /**
   * Waits for the given time or until the given JS condition becomes TRUE.
   *
Loading