InternalTypedDataTestTrait.php in Drupal 10
File
core/modules/serialization/tests/src/Unit/Normalizer/InternalTypedDataTestTrait.php
View source
<?php
namespace Drupal\Tests\serialization\Unit\Normalizer;
use Drupal\Core\TypedData\DataDefinitionInterface;
use Drupal\Core\TypedData\TypedDataInterface;
trait InternalTypedDataTestTrait {
protected function getTypedDataProperty($internal = TRUE) {
$definition = $this
->prophesize(DataDefinitionInterface::class);
$definition
->isInternal()
->willReturn($internal)
->shouldBeCalled();
$definition = $definition
->reveal();
$property = $this
->prophesize(TypedDataInterface::class);
$property
->getDataDefinition()
->willReturn($definition)
->shouldBeCalled();
return $property
->reveal();
}
}