function KernelTestBaseTest::testAssertIdenticalObject

Tests the deprecation of AssertLegacyTrait::assertIdenticalObject.

@group legacy

File

core/tests/Drupal/KernelTests/KernelTestBaseTest.php, line 358

Class

KernelTestBaseTest
@coversDefaultClass <a href="/api/drupal/core%21tests%21Drupal%21KernelTests%21KernelTestBase.php/class/KernelTestBase/9" title="Base class for functional integration tests." class="local">\Drupal\KernelTests\KernelTestBase</a>

Namespace

Drupal\KernelTests

Code

public function testAssertIdenticalObject() {
    $this->expectDeprecation('AssertLegacyTrait::assertIdenticalObject() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertEquals() instead. See https://www.drupal.org/node/3129738');
    $this->assertIdenticalObject((object) [
        'foo' => 'bar',
    ], (object) [
        'foo' => 'bar',
    ]);
}

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