Commit 1f9f3623 authored by Erik Stielstra's avatar Erik Stielstra Committed by Erik Stielstra
Browse files

Issue #3262909 by Sutharsan: Fix deprecated test code

parent c320938b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
 */
class FieldValueTest extends EntityKernelTestBase {

  public static $modules = [
  protected static $modules = [
    'twig_field_value',
    'user',
    'entity_test',
@@ -24,7 +24,7 @@ class FieldValueTest extends EntityKernelTestBase {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();
    $fieldStorage = FieldStorageConfig::create([
      'field_name' => 'field_reference',
@@ -84,9 +84,9 @@ class FieldValueTest extends EntityKernelTestBase {

    // Check the field values by rendering the formatter without any filter.
    $content = \Drupal::service('renderer')->renderPlain($element);
    $this->assertContains('entity1', (string) $content);
    $this->assertNotContains('forbid_access', (string) $content);
    $this->assertContains('entity3', (string) $content);
    $this->assertStringContainsString('entity1', (string) $content);
    $this->assertStringNotContainsString('forbid_access', (string) $content);
    $this->assertStringContainsString('entity3', (string) $content);

    // Check output of the field_value filter.
    $element = [
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class FieldRawValueTest extends UnitTestCase {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected function setUp(): void {
    $this->extension = new FieldValueExtension();
  }

+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class FieldTargetEntityTest extends UnitTestCase {
   */
  protected $extension;

  protected function setUp() {
  protected function setUp(): void {
    $this->extension = new FieldValueExtension();
  }

+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class FieldValueTest extends UnitTestCase {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected function setUp(): void {
    $this->extension = new FieldValueExtension();
  }