public function UuidResolverTest::testResolveNoEntity in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php \Drupal\Tests\serialization\Unit\EntityResolver\UuidResolverTest::testResolveNoEntity()
Test resolve() with correct interface but no matching entity for the UUID.
File
- core/
modules/ serialization/ tests/ src/ Unit/ EntityResolver/ UuidResolverTest.php, line 73 - Contains \Drupal\Tests\serialization\Unit\EntityResolver\UuidResolverTest.
Class
- UuidResolverTest
- @coversDefaultClass \Drupal\serialization\EntityResolver\UuidResolver @group serialization
Namespace
Drupal\Tests\serialization\Unit\EntityResolverCode
public function testResolveNoEntity() {
$uuid = '392eab92-35c2-4625-872d-a9dab4da008e';
$this->entityManager
->expects($this
->once())
->method('loadEntityByUuid')
->with('test_type')
->will($this
->returnValue(NULL));
$normalizer = $this
->getMock('Drupal\\serialization\\EntityResolver\\UuidReferenceInterface');
$normalizer
->expects($this
->once())
->method('getUuid')
->with(array())
->will($this
->returnValue($uuid));
$this
->assertNull($this->resolver
->resolve($normalizer, array(), 'test_type'));
}