You are here

public function MarkupInterfaceComparatorTest::testAssertEquals in Drupal 8

Same name and namespace in other branches
  1. 9 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 145

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);
    }
  }
}