function ChainEntityResolverTest::testResolverWithLastResolved

Same name in other branches
  1. 9 core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithLastResolved()
  2. 10 core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithLastResolved()
  3. 11.x core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithLastResolved()

Test the resolve method with a matching resolver last.

@covers ::__construct @covers ::resolve

File

core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php, line 97

Class

ChainEntityResolverTest
@coversDefaultClass \Drupal\serialization\EntityResolver\ChainEntityResolver @group serialization

Namespace

Drupal\Tests\serialization\Unit\EntityResolver

Code

public function testResolverWithLastResolved() {
    $resolvers = [
        $this->createEntityResolverMock(),
        $this->createEntityResolverMock(10),
    ];
    $resolver = new ChainEntityResolver($resolvers);
    $this->assertSame(10, $resolver->resolve($this->testNormalizer, $this->testData, $this->testEntityType));
}

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