Loading core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php +47 −7 Changes for core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php: 47 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -243,8 +243,8 @@ public function testGetFormObject() { $apple_form = $this->entityTypeManager->getFormObject('apple', 'default'); $this->assertInstanceOf(TestEntityForm::class, $apple_form); $this->assertAttributeInstanceOf(ModuleHandlerInterface::class, 'moduleHandler', $apple_form); $this->assertAttributeInstanceOf(TranslationInterface::class, 'stringTranslation', $apple_form); $this->assertInstanceOf(ModuleHandlerInterface::class, $apple_form->moduleHandler); $this->assertInstanceOf(TranslationInterface::class, $apple_form->stringTranslation); $banana_form = $this->entityTypeManager->getFormObject('banana', 'default'); $this->assertInstanceOf(TestEntityFormInjected::class, $banana_form); Loading Loading @@ -272,7 +272,7 @@ public function testGetFormObjectInvalidOperation() { * @covers ::getHandler */ public function testGetHandler() { $class = $this->getTestHandlerClass(); $class = get_class($this->getMockForAbstractClass(TestEntityHandlerBase::class)); $apple = $this->prophesize(EntityTypeInterface::class); $apple->getHandlerClass('storage')->willReturn($class); Loading @@ -282,8 +282,8 @@ public function testGetHandler() { $apple_controller = $this->entityTypeManager->getHandler('apple', 'storage'); $this->assertInstanceOf($class, $apple_controller); $this->assertAttributeInstanceOf(ModuleHandlerInterface::class, 'moduleHandler', $apple_controller); $this->assertAttributeInstanceOf(TranslationInterface::class, 'stringTranslation', $apple_controller); $this->assertInstanceOf(ModuleHandlerInterface::class, $apple_controller->moduleHandler); $this->assertInstanceOf(TranslationInterface::class, $apple_controller->stringTranslation); } /** Loading Loading @@ -312,8 +312,8 @@ public function testGetRouteProviders() { $apple_route_provider = $this->entityTypeManager->getRouteProviders('apple'); $this->assertInstanceOf(TestRouteProvider::class, $apple_route_provider['default']); $this->assertAttributeInstanceOf(ModuleHandlerInterface::class, 'moduleHandler', $apple_route_provider['default']); $this->assertAttributeInstanceOf(TranslationInterface::class, 'stringTranslation', $apple_route_provider['default']); $this->assertInstanceOf(ModuleHandlerInterface::class, $apple_route_provider['default']->moduleHandler); $this->assertInstanceOf(TranslationInterface::class, $apple_route_provider['default']->stringTranslation); } /** Loading Loading @@ -396,6 +396,26 @@ protected function getTestHandlerClass() { } /** * Provides a test entity handler. */ abstract class TestEntityHandlerBase extends EntityHandlerBase { /** * {@inheritdoc} */ public $moduleHandler; /** * {@inheritdoc} */ public $stringTranslation; } /** * Provides a test entity type manager. */ class TestEntityTypeManager extends EntityTypeManager { /** Loading @@ -415,6 +435,16 @@ public function setDiscovery(DiscoveryInterface $discovery) { */ class TestEntityForm extends EntityHandlerBase { /** * {@inheritdoc} */ public $moduleHandler; /** * {@inheritdoc} */ public $stringTranslation; /** * The entity type manager. * Loading Loading @@ -496,4 +526,14 @@ public static function create(ContainerInterface $container) { */ class TestRouteProvider extends EntityHandlerBase { /** * {@inheritdoc} */ public $moduleHandler; /** * {@inheritdoc} */ public $stringTranslation; } core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php +0 −1 Changes for core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php: 0 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ trait PHPUnit8Warnings { 'readAttribute() is deprecated and will be removed in PHPUnit 9.', 'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.', ]; /** Loading Loading
core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php +47 −7 Changes for core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php: 47 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -243,8 +243,8 @@ public function testGetFormObject() { $apple_form = $this->entityTypeManager->getFormObject('apple', 'default'); $this->assertInstanceOf(TestEntityForm::class, $apple_form); $this->assertAttributeInstanceOf(ModuleHandlerInterface::class, 'moduleHandler', $apple_form); $this->assertAttributeInstanceOf(TranslationInterface::class, 'stringTranslation', $apple_form); $this->assertInstanceOf(ModuleHandlerInterface::class, $apple_form->moduleHandler); $this->assertInstanceOf(TranslationInterface::class, $apple_form->stringTranslation); $banana_form = $this->entityTypeManager->getFormObject('banana', 'default'); $this->assertInstanceOf(TestEntityFormInjected::class, $banana_form); Loading Loading @@ -272,7 +272,7 @@ public function testGetFormObjectInvalidOperation() { * @covers ::getHandler */ public function testGetHandler() { $class = $this->getTestHandlerClass(); $class = get_class($this->getMockForAbstractClass(TestEntityHandlerBase::class)); $apple = $this->prophesize(EntityTypeInterface::class); $apple->getHandlerClass('storage')->willReturn($class); Loading @@ -282,8 +282,8 @@ public function testGetHandler() { $apple_controller = $this->entityTypeManager->getHandler('apple', 'storage'); $this->assertInstanceOf($class, $apple_controller); $this->assertAttributeInstanceOf(ModuleHandlerInterface::class, 'moduleHandler', $apple_controller); $this->assertAttributeInstanceOf(TranslationInterface::class, 'stringTranslation', $apple_controller); $this->assertInstanceOf(ModuleHandlerInterface::class, $apple_controller->moduleHandler); $this->assertInstanceOf(TranslationInterface::class, $apple_controller->stringTranslation); } /** Loading Loading @@ -312,8 +312,8 @@ public function testGetRouteProviders() { $apple_route_provider = $this->entityTypeManager->getRouteProviders('apple'); $this->assertInstanceOf(TestRouteProvider::class, $apple_route_provider['default']); $this->assertAttributeInstanceOf(ModuleHandlerInterface::class, 'moduleHandler', $apple_route_provider['default']); $this->assertAttributeInstanceOf(TranslationInterface::class, 'stringTranslation', $apple_route_provider['default']); $this->assertInstanceOf(ModuleHandlerInterface::class, $apple_route_provider['default']->moduleHandler); $this->assertInstanceOf(TranslationInterface::class, $apple_route_provider['default']->stringTranslation); } /** Loading Loading @@ -396,6 +396,26 @@ protected function getTestHandlerClass() { } /** * Provides a test entity handler. */ abstract class TestEntityHandlerBase extends EntityHandlerBase { /** * {@inheritdoc} */ public $moduleHandler; /** * {@inheritdoc} */ public $stringTranslation; } /** * Provides a test entity type manager. */ class TestEntityTypeManager extends EntityTypeManager { /** Loading @@ -415,6 +435,16 @@ public function setDiscovery(DiscoveryInterface $discovery) { */ class TestEntityForm extends EntityHandlerBase { /** * {@inheritdoc} */ public $moduleHandler; /** * {@inheritdoc} */ public $stringTranslation; /** * The entity type manager. * Loading Loading @@ -496,4 +526,14 @@ public static function create(ContainerInterface $container) { */ class TestRouteProvider extends EntityHandlerBase { /** * {@inheritdoc} */ public $moduleHandler; /** * {@inheritdoc} */ public $stringTranslation; }
core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php +0 −1 Changes for core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php: 0 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ trait PHPUnit8Warnings { 'readAttribute() is deprecated and will be removed in PHPUnit 9.', 'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.', ]; /** Loading