function MarkupInterfaceComparatorTest::testAssertEquals

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php \Drupal\KernelTests\Core\Test\Comparator\MarkupInterfaceComparatorTest::testAssertEquals()
  2. 10 core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php \Drupal\KernelTests\Core\Test\Comparator\MarkupInterfaceComparatorTest::testAssertEquals()
  3. 11.x core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php \Drupal\KernelTests\Core\Test\Comparator\MarkupInterfaceComparatorTest::testAssertEquals()

@covers ::assertEquals @dataProvider dataSetProvider

File

core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php, line 146

Class

MarkupInterfaceComparatorTest
Tests \Drupal\TestTools\Comparator\MarkupInterfaceComparator.

Namespace

Drupal\KernelTests\Core\Test\Comparator

Code

public function testAssertEquals($expected, $actual, $accepts_result, $equals_result) {
    try {
        $this->assertNull($this->comparator
            ->assertEquals($expected, $actual));
        $this->assertTrue($equals_result);
    } catch (\Throwable $e) {
        if ($equals_result === FALSE) {
            $this->assertNotNull($e->getMessage());
        }
        else {
            $this->assertInstanceOf($equals_result, $e);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.