You are here

public function ChainEntityResolverTest::testResolverWithResolvedToZero in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest::testResolverWithResolvedToZero()

Test the resolve method where one resolver returns 0.

@covers ::__construct @covers ::resolve

File

core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php, line 119
Contains \Drupal\Tests\serialization\Unit\EntityResolver\ChainEntityResolverTest.

Class

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

Namespace

Drupal\Tests\serialization\Unit\EntityResolver

Code

public function testResolverWithResolvedToZero() {
  $resolvers = array(
    $this
      ->createEntityResolverMock(0),
    $this
      ->createEntityResolverMock(NULL, FALSE),
  );
  $resolver = new ChainEntityResolver($resolvers);
  $this
    ->assertSame(0, $resolver
    ->resolve($this->testNormalizer, $this->testData, $this->testEntityType));
}