Loading core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +4 −5 Original line number Diff line number Diff line Loading @@ -83,11 +83,10 @@ public function testSettingsForm() { 'aggregator_allowed_html_tags' => '', ]); $test_processor = $this->getMock( 'Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor', ['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm'], [[], 'aggregator_test', ['description' => ''], $this->configFactory] ); $test_processor = $this->getMockBuilder('Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor') ->setMethods(['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm']) ->setConstructorArgs([[], 'aggregator_test', ['description' => ''], $this->configFactory]) ->getMock(); $test_processor->expects($this->at(0)) ->method('buildConfigurationForm') ->with($this->anything(), $form_state) Loading core/modules/ban/tests/src/Unit/BanMiddlewareTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -41,8 +41,8 @@ class BanMiddlewareTest extends UnitTestCase { protected function setUp() { parent::setUp(); $this->kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); $this->banManager = $this->getMock('Drupal\ban\BanIpManagerInterface'); $this->kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface'); $this->banManager = $this->createMock('Drupal\ban\BanIpManagerInterface'); $this->banMiddleware = new BanMiddleware($this->kernel, $this->banManager); } Loading core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -63,18 +63,18 @@ class BlockConfigEntityUnitTest extends UnitTestCase { protected function setUp() { $this->entityTypeId = $this->randomMachineName(); $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface'); $this->entityType = $this->createMock('\Drupal\Core\Entity\EntityTypeInterface'); $this->entityType->expects($this->any()) ->method('getProvider') ->will($this->returnValue('block')); $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class); $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class); $this->entityTypeManager->expects($this->any()) ->method('getDefinition') ->with($this->entityTypeId) ->will($this->returnValue($this->entityType)); $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface'); $this->uuid = $this->createMock('\Drupal\Component\Uuid\UuidInterface'); $this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class); $this->themeHandler = $this->prophesize(ThemeHandlerInterface::class); Loading core/modules/block/tests/src/Unit/BlockFormTest.php +7 −7 Original line number Diff line number Diff line Loading @@ -70,13 +70,13 @@ class BlockFormTest extends UnitTestCase { protected function setUp() { parent::setUp(); $this->conditionManager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface'); $this->language = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); $this->contextRepository = $this->getMock('Drupal\Core\Plugin\Context\ContextRepositoryInterface'); $this->conditionManager = $this->createMock('Drupal\Core\Executable\ExecutableManagerInterface'); $this->language = $this->createMock('Drupal\Core\Language\LanguageManagerInterface'); $this->contextRepository = $this->createMock('Drupal\Core\Plugin\Context\ContextRepositoryInterface'); $this->entityTypeManager = $this->getMock('Drupal\Core\Entity\EntityTypeManagerInterface'); $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $this->themeHandler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface'); $this->entityTypeManager = $this->createMock('Drupal\Core\Entity\EntityTypeManagerInterface'); $this->storage = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $this->themeHandler = $this->createMock('Drupal\Core\Extension\ThemeHandlerInterface'); $this->entityTypeManager->expects($this->any()) ->method('getStorage') ->will($this->returnValue($this->storage)); Loading Loading @@ -123,7 +123,7 @@ public function testGetUniqueMachineName() { $blocks['other_test_1'] = $this->getBlockMockWithMachineName('other_test'); $blocks['other_test_2'] = $this->getBlockMockWithMachineName('other_test'); $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface'); $query = $this->createMock('Drupal\Core\Entity\Query\QueryInterface'); $query->expects($this->exactly(5)) ->method('condition') ->will($this->returnValue($query)); Loading core/modules/block/tests/src/Unit/BlockRepositoryTest.php +5 −5 Original line number Diff line number Diff line Loading @@ -60,13 +60,13 @@ protected function setUp() { 'bottom', ]); $theme_manager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface'); $theme_manager = $this->createMock('Drupal\Core\Theme\ThemeManagerInterface'); $theme_manager->expects($this->atLeastOnce()) ->method('getActiveTheme') ->will($this->returnValue($active_theme)); $this->contextHandler = $this->getMock('Drupal\Core\Plugin\Context\ContextHandlerInterface'); $this->blockStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $this->contextHandler = $this->createMock('Drupal\Core\Plugin\Context\ContextHandlerInterface'); $this->blockStorage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); /** @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject $entity_type_manager */ $entity_type_manager = $this->createMock(EntityTypeManagerInterface::class); $entity_type_manager->expects($this->any()) Loading @@ -86,7 +86,7 @@ protected function setUp() { public function testGetVisibleBlocksPerRegion(array $blocks_config, array $expected_blocks) { $blocks = []; foreach ($blocks_config as $block_id => $block_config) { $block = $this->getMock('Drupal\block\BlockInterface'); $block = $this->createMock('Drupal\block\BlockInterface'); $block->expects($this->once()) ->method('access') ->will($this->returnValue($block_config[0])); Loading Loading @@ -155,7 +155,7 @@ public function providerBlocksConfig() { * @covers ::getVisibleBlocksPerRegion */ public function testGetVisibleBlocksPerRegionWithContext() { $block = $this->getMock('Drupal\block\BlockInterface'); $block = $this->createMock('Drupal\block\BlockInterface'); $block->expects($this->once()) ->method('access') ->willReturn(AccessResult::allowed()->addCacheTags(['config:block.block.block_id'])); Loading Loading
core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +4 −5 Original line number Diff line number Diff line Loading @@ -83,11 +83,10 @@ public function testSettingsForm() { 'aggregator_allowed_html_tags' => '', ]); $test_processor = $this->getMock( 'Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor', ['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm'], [[], 'aggregator_test', ['description' => ''], $this->configFactory] ); $test_processor = $this->getMockBuilder('Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor') ->setMethods(['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm']) ->setConstructorArgs([[], 'aggregator_test', ['description' => ''], $this->configFactory]) ->getMock(); $test_processor->expects($this->at(0)) ->method('buildConfigurationForm') ->with($this->anything(), $form_state) Loading
core/modules/ban/tests/src/Unit/BanMiddlewareTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -41,8 +41,8 @@ class BanMiddlewareTest extends UnitTestCase { protected function setUp() { parent::setUp(); $this->kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); $this->banManager = $this->getMock('Drupal\ban\BanIpManagerInterface'); $this->kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface'); $this->banManager = $this->createMock('Drupal\ban\BanIpManagerInterface'); $this->banMiddleware = new BanMiddleware($this->kernel, $this->banManager); } Loading
core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -63,18 +63,18 @@ class BlockConfigEntityUnitTest extends UnitTestCase { protected function setUp() { $this->entityTypeId = $this->randomMachineName(); $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface'); $this->entityType = $this->createMock('\Drupal\Core\Entity\EntityTypeInterface'); $this->entityType->expects($this->any()) ->method('getProvider') ->will($this->returnValue('block')); $this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class); $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class); $this->entityTypeManager->expects($this->any()) ->method('getDefinition') ->with($this->entityTypeId) ->will($this->returnValue($this->entityType)); $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface'); $this->uuid = $this->createMock('\Drupal\Component\Uuid\UuidInterface'); $this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class); $this->themeHandler = $this->prophesize(ThemeHandlerInterface::class); Loading
core/modules/block/tests/src/Unit/BlockFormTest.php +7 −7 Original line number Diff line number Diff line Loading @@ -70,13 +70,13 @@ class BlockFormTest extends UnitTestCase { protected function setUp() { parent::setUp(); $this->conditionManager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface'); $this->language = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); $this->contextRepository = $this->getMock('Drupal\Core\Plugin\Context\ContextRepositoryInterface'); $this->conditionManager = $this->createMock('Drupal\Core\Executable\ExecutableManagerInterface'); $this->language = $this->createMock('Drupal\Core\Language\LanguageManagerInterface'); $this->contextRepository = $this->createMock('Drupal\Core\Plugin\Context\ContextRepositoryInterface'); $this->entityTypeManager = $this->getMock('Drupal\Core\Entity\EntityTypeManagerInterface'); $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $this->themeHandler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface'); $this->entityTypeManager = $this->createMock('Drupal\Core\Entity\EntityTypeManagerInterface'); $this->storage = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $this->themeHandler = $this->createMock('Drupal\Core\Extension\ThemeHandlerInterface'); $this->entityTypeManager->expects($this->any()) ->method('getStorage') ->will($this->returnValue($this->storage)); Loading Loading @@ -123,7 +123,7 @@ public function testGetUniqueMachineName() { $blocks['other_test_1'] = $this->getBlockMockWithMachineName('other_test'); $blocks['other_test_2'] = $this->getBlockMockWithMachineName('other_test'); $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface'); $query = $this->createMock('Drupal\Core\Entity\Query\QueryInterface'); $query->expects($this->exactly(5)) ->method('condition') ->will($this->returnValue($query)); Loading
core/modules/block/tests/src/Unit/BlockRepositoryTest.php +5 −5 Original line number Diff line number Diff line Loading @@ -60,13 +60,13 @@ protected function setUp() { 'bottom', ]); $theme_manager = $this->getMock('Drupal\Core\Theme\ThemeManagerInterface'); $theme_manager = $this->createMock('Drupal\Core\Theme\ThemeManagerInterface'); $theme_manager->expects($this->atLeastOnce()) ->method('getActiveTheme') ->will($this->returnValue($active_theme)); $this->contextHandler = $this->getMock('Drupal\Core\Plugin\Context\ContextHandlerInterface'); $this->blockStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $this->contextHandler = $this->createMock('Drupal\Core\Plugin\Context\ContextHandlerInterface'); $this->blockStorage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); /** @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject $entity_type_manager */ $entity_type_manager = $this->createMock(EntityTypeManagerInterface::class); $entity_type_manager->expects($this->any()) Loading @@ -86,7 +86,7 @@ protected function setUp() { public function testGetVisibleBlocksPerRegion(array $blocks_config, array $expected_blocks) { $blocks = []; foreach ($blocks_config as $block_id => $block_config) { $block = $this->getMock('Drupal\block\BlockInterface'); $block = $this->createMock('Drupal\block\BlockInterface'); $block->expects($this->once()) ->method('access') ->will($this->returnValue($block_config[0])); Loading Loading @@ -155,7 +155,7 @@ public function providerBlocksConfig() { * @covers ::getVisibleBlocksPerRegion */ public function testGetVisibleBlocksPerRegionWithContext() { $block = $this->getMock('Drupal\block\BlockInterface'); $block = $this->createMock('Drupal\block\BlockInterface'); $block->expects($this->once()) ->method('access') ->willReturn(AccessResult::allowed()->addCacheTags(['config:block.block.block_id'])); Loading