function ChainEntityResolverTest::testResolverWithNoneResolved

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

Tests the resolve method with no matching resolvers.

@covers ::__construct @covers ::resolve

File

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

Class

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

Namespace

Drupal\Tests\serialization\Unit\EntityResolver

Code

public function testResolverWithNoneResolved() : void {
    $resolvers = [
        $this->createEntityResolverMock(),
        $this->createEntityResolverMock(),
    ];
    $resolver = new ChainEntityResolver($resolvers);
    $this->assertNull($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.