Loading core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -267,7 +267,7 @@ public function testLoadByEntityTypeBundle($config_id, ContentLanguageSettings $ ->with('language_content_settings') ->willReturn($this->configEntityStorageInterface); $entity_type_repository = $this->getMockForAbstractClass(EntityTypeRepositoryInterface::class); $entity_type_repository = $this->createMock(EntityTypeRepositoryInterface::class); $entity_type_repository->expects($this->any()) ->method('getEntityTypeFromClass') ->with(ContentLanguageSettings::class) Loading core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public function testCalculateDependencies() { ->with('image_style') ->willReturn($storage); $entity_type_repository = $this->getMockForAbstractClass(EntityTypeRepositoryInterface::class); $entity_type_repository = $this->createMock(EntityTypeRepositoryInterface::class); $entity_type_repository->expects($this->any()) ->method('getEntityTypeFromClass') ->with('Drupal\image\Entity\ImageStyle') Loading core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public function testTitleQuery() { ], 'user_role'); // Creates a stub entity storage; $role_storage = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityStorageInterface'); $role_storage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); $role_storage->expects($this->any()) ->method('loadMultiple') ->willReturnMap([ Loading core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php +3 −9 Original line number Diff line number Diff line Loading @@ -49,9 +49,7 @@ public function testGetContextValue($expected, $context_value, $is_required, $da // throwing an exception if the definition requires it. else { // Create a mock definition. $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface') ->onlyMethods(['isRequired', 'getDataType']) ->getMockForAbstractClass(); $mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface'); // Set expectation for isRequired(). $mock_definition->expects($this->once()) Loading Loading @@ -103,9 +101,7 @@ public static function providerHasContextValue() { * @dataProvider providerHasContextValue */ public function testHasContextValue($has_context_value, $default_value): void { $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface') ->onlyMethods(['getDefaultValue']) ->getMockForAbstractClass(); $mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface'); $mock_definition->expects($this->atLeastOnce()) ->method('getDefaultValue') Loading @@ -121,9 +117,7 @@ public function testHasContextValue($has_context_value, $default_value): void { * @covers ::getContextValue */ public function testDefaultValue() { $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface') ->onlyMethods(['getDefaultValue']) ->getMockForAbstractClass(); $mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface'); $mock_definition->expects($this->once()) ->method('getDefaultValue') Loading core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php +4 −9 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\Component\Plugin\Discovery; use Drupal\Component\Plugin\Discovery\DiscoveryInterface; use Drupal\Component\Plugin\Discovery\StaticDiscovery; use Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator; use PHPUnit\Framework\TestCase; Loading @@ -26,9 +27,7 @@ class StaticDiscoveryDecoratorTest extends TestCase { * called once. */ public function getRegisterDefinitionsCallback() { $mock_callable = $this->getMockBuilder(StaticDiscoveryDecoratorTestMockInterface::class) ->onlyMethods(['registerDefinitionsCallback']) ->getMock(); $mock_callable = $this->createMock(StaticDiscoveryDecoratorTestMockInterface::class); // Set expectations for the callback method. $mock_callable->expects($this->once()) ->method('registerDefinitionsCallback'); Loading Loading @@ -88,9 +87,7 @@ public function testGetDefinition($expected, $has_register_definitions, $excepti $ref_definitions->setValue($mock_decorator, []); // Mock a decorated object. $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface') ->onlyMethods(['getDefinitions']) ->getMockForAbstractClass(); $mock_decorated = $this->createMock(DiscoveryInterface::class); // Return our definitions from getDefinitions(). $mock_decorated->expects($this->once()) ->method('getDefinitions') Loading Loading @@ -155,9 +152,7 @@ public function testGetDefinitions($has_register_definitions, $definitions) { $ref_definitions->setValue($mock_decorator, []); // Mock a decorated object. $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface') ->onlyMethods(['getDefinitions']) ->getMockForAbstractClass(); $mock_decorated = $this->createMock(DiscoveryInterface::class); // Our mocked method will return any arguments sent to it. $mock_decorated->expects($this->once()) ->method('getDefinitions') Loading Loading
core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -267,7 +267,7 @@ public function testLoadByEntityTypeBundle($config_id, ContentLanguageSettings $ ->with('language_content_settings') ->willReturn($this->configEntityStorageInterface); $entity_type_repository = $this->getMockForAbstractClass(EntityTypeRepositoryInterface::class); $entity_type_repository = $this->createMock(EntityTypeRepositoryInterface::class); $entity_type_repository->expects($this->any()) ->method('getEntityTypeFromClass') ->with(ContentLanguageSettings::class) Loading
core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public function testCalculateDependencies() { ->with('image_style') ->willReturn($storage); $entity_type_repository = $this->getMockForAbstractClass(EntityTypeRepositoryInterface::class); $entity_type_repository = $this->createMock(EntityTypeRepositoryInterface::class); $entity_type_repository->expects($this->any()) ->method('getEntityTypeFromClass') ->with('Drupal\image\Entity\ImageStyle') Loading
core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public function testTitleQuery() { ], 'user_role'); // Creates a stub entity storage; $role_storage = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityStorageInterface'); $role_storage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); $role_storage->expects($this->any()) ->method('loadMultiple') ->willReturnMap([ Loading
core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php +3 −9 Original line number Diff line number Diff line Loading @@ -49,9 +49,7 @@ public function testGetContextValue($expected, $context_value, $is_required, $da // throwing an exception if the definition requires it. else { // Create a mock definition. $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface') ->onlyMethods(['isRequired', 'getDataType']) ->getMockForAbstractClass(); $mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface'); // Set expectation for isRequired(). $mock_definition->expects($this->once()) Loading Loading @@ -103,9 +101,7 @@ public static function providerHasContextValue() { * @dataProvider providerHasContextValue */ public function testHasContextValue($has_context_value, $default_value): void { $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface') ->onlyMethods(['getDefaultValue']) ->getMockForAbstractClass(); $mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface'); $mock_definition->expects($this->atLeastOnce()) ->method('getDefaultValue') Loading @@ -121,9 +117,7 @@ public function testHasContextValue($has_context_value, $default_value): void { * @covers ::getContextValue */ public function testDefaultValue() { $mock_definition = $this->getMockBuilder('Drupal\Component\Plugin\Context\ContextDefinitionInterface') ->onlyMethods(['getDefaultValue']) ->getMockForAbstractClass(); $mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface'); $mock_definition->expects($this->once()) ->method('getDefaultValue') Loading
core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php +4 −9 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Drupal\Tests\Component\Plugin\Discovery; use Drupal\Component\Plugin\Discovery\DiscoveryInterface; use Drupal\Component\Plugin\Discovery\StaticDiscovery; use Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator; use PHPUnit\Framework\TestCase; Loading @@ -26,9 +27,7 @@ class StaticDiscoveryDecoratorTest extends TestCase { * called once. */ public function getRegisterDefinitionsCallback() { $mock_callable = $this->getMockBuilder(StaticDiscoveryDecoratorTestMockInterface::class) ->onlyMethods(['registerDefinitionsCallback']) ->getMock(); $mock_callable = $this->createMock(StaticDiscoveryDecoratorTestMockInterface::class); // Set expectations for the callback method. $mock_callable->expects($this->once()) ->method('registerDefinitionsCallback'); Loading Loading @@ -88,9 +87,7 @@ public function testGetDefinition($expected, $has_register_definitions, $excepti $ref_definitions->setValue($mock_decorator, []); // Mock a decorated object. $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface') ->onlyMethods(['getDefinitions']) ->getMockForAbstractClass(); $mock_decorated = $this->createMock(DiscoveryInterface::class); // Return our definitions from getDefinitions(). $mock_decorated->expects($this->once()) ->method('getDefinitions') Loading Loading @@ -155,9 +152,7 @@ public function testGetDefinitions($has_register_definitions, $definitions) { $ref_definitions->setValue($mock_decorator, []); // Mock a decorated object. $mock_decorated = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface') ->onlyMethods(['getDefinitions']) ->getMockForAbstractClass(); $mock_decorated = $this->createMock(DiscoveryInterface::class); // Our mocked method will return any arguments sent to it. $mock_decorated->expects($this->once()) ->method('getDefinitions') Loading