function ChainEntityResolverTest::testResolverWithResolvedToZero

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

Tests the resolve method where one resolver returns 0.

@covers ::__construct @covers ::resolve

File

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

Class

ChainEntityResolverTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21serialization%21src%21EntityResolver%21ChainEntityResolver.php/class/ChainEntityResolver/9" title="Resolver delegating the entity resolution to a chain of resolvers." class="local">\Drupal\serialization\EntityResolver\ChainEntityResolver</a> @group serialization

Namespace

Drupal\Tests\serialization\Unit\EntityResolver

Code

public function testResolverWithResolvedToZero() {
    $resolvers = [
        $this->createEntityResolverMock(0),
        $this->createEntityResolverMock(NULL, FALSE),
    ];
    $resolver = new ChainEntityResolver($resolvers);
    $this->assertSame(0, $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.