function ChainEntityResolverTest::testResolverWithFirstResolved
Same name in other branches
- 9 core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithFirstResolved()
- 8.9.x core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithFirstResolved()
- 10 core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithFirstResolved()
Tests the resolve method with a matching resolver first.
@covers ::__construct @covers ::resolve
File
-
core/
modules/ serialization/ tests/ src/ Unit/ EntityResolver/ ChainEntityResolverTest.php, line 84
Class
- ChainEntityResolverTest
- @coversDefaultClass \Drupal\serialization\EntityResolver\ChainEntityResolver @group serialization
Namespace
Drupal\Tests\serialization\Unit\EntityResolverCode
public function testResolverWithFirstResolved() : void {
$resolvers = [
$this->createEntityResolverMock(10),
$this->createEntityResolverMock(NULL, FALSE),
];
$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.