diff --git a/core/modules/migrate_drupal/tests/src/source/d6/BlockTest.php b/core/modules/migrate_drupal/tests/src/source/d6/BlockTest.php index 84a167a2458..ce2f17ee1c6 100644 --- a/core/modules/migrate_drupal/tests/src/source/d6/BlockTest.php +++ b/core/modules/migrate_drupal/tests/src/source/d6/BlockTest.php @@ -82,13 +82,6 @@ class BlockTest extends MigrateSqlSourceTestCase { parent::setUp(); } - /** - * {@inheritdoc} - */ - public function testRetrieval() { - // FakeSelect does not support multiple source identifiers, can not test. - } - } namespace Drupal\migrate_drupal\Tests\source\d6; diff --git a/core/modules/migrate_drupal/tests/src/source/d6/FieldInstanceTest.php b/core/modules/migrate_drupal/tests/src/source/d6/FieldInstanceTest.php index 83ce076cfad..f3fd49b41a1 100644 --- a/core/modules/migrate_drupal/tests/src/source/d6/FieldInstanceTest.php +++ b/core/modules/migrate_drupal/tests/src/source/d6/FieldInstanceTest.php @@ -94,13 +94,6 @@ class FieldInstanceTest extends MigrateSqlSourceTestCase { parent::setUp(); } - /** - * {@inheritdoc} - */ - public function testRetrieval() { - // FakeSelect does not support multiple source identifiers, can not test. - } - } namespace Drupal\migrate_drupal\Tests\source\d6; diff --git a/core/modules/migrate_drupal/tests/src/source/d6/NodeRevisionTest.php b/core/modules/migrate_drupal/tests/src/source/d6/NodeRevisionTest.php index 54f64fcb63d..e87cb67c4c7 100644 --- a/core/modules/migrate_drupal/tests/src/source/d6/NodeRevisionTest.php +++ b/core/modules/migrate_drupal/tests/src/source/d6/NodeRevisionTest.php @@ -329,7 +329,8 @@ class NodeRevisionTest extends MigrateSqlSourceTestCase { * {@inheritdoc} */ public function testRetrieval() { - // FakeSelect does not support multiple source identifiers, can not test. + // @todo: Fix this as per https://www.drupal.org/node/2299795 + $this->markTestIncomplete('FakeSelect does not support multiple source identifiers, can not test.'); } } diff --git a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php index 8eddb4854ed..46232a5fefa 100644 --- a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php @@ -13,7 +13,7 @@ use Drupal\Component\Utility\String; use Drupal\Tests\UnitTestCase; /** - * @coversDefaultClass \Drupal\Component\Utility\Url + * @coversDefaultClass \Drupal\Component\Utility\UrlHelper * @group Utility */ class UrlHelperTest extends UnitTestCase { diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php index adb8979ab65..9bc1b8523be 100644 --- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php @@ -264,7 +264,8 @@ class ContentEntityBaseUnitTest extends UnitTestCase { // This method is internal, so check for errors on calling it only. $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $record = new \stdClass(); - $this->entity->preSaveRevision($storage, $record); + // Our mocked entity->preSaveRevision() returns NULL, so assert that. + $this->assertNull($this->entity->preSaveRevision($storage, $record)); } /** @@ -352,7 +353,8 @@ class ContentEntityBaseUnitTest extends UnitTestCase { public function testSetContext() { $name = $this->randomName(); $parent = $this->getMock('\Drupal\Core\TypedData\TypedDataInterface'); - $this->entity->setContext($name, $parent); + // Our mocked entity->setContext() returns NULL, so assert that. + $this->assertNull($this->entity->setContext($name, $parent)); } /** diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php index b070e357866..40a000d013f 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php @@ -60,7 +60,6 @@ class EntityResolverManagerTest extends UnitTestCase { * {@inheritdoc} * * @covers ::__construct() - * @covers ::setContainer() */ protected function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php index 0ca1e8525cd..8b63f615097 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php @@ -530,7 +530,8 @@ class EntityUnitTest extends UnitTestCase { public function testPreSave() { // This method is internal, so check for errors on calling it only. $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); - $this->entity->preSave($storage); + // Our mocked entity->preSave() returns NULL, so assert that. + $this->assertNull($this->entity->preSave($storage)); } /** @@ -566,7 +567,8 @@ class EntityUnitTest extends UnitTestCase { // This method is internal, so check for errors on calling it only. $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $values = array(); - $this->entity->preCreate($storage, $values); + // Our mocked entity->preCreate() returns NULL, so assert that. + $this->assertNull($this->entity->preCreate($storage, $values)); } /** @@ -575,7 +577,8 @@ class EntityUnitTest extends UnitTestCase { public function testPostCreate() { // This method is internal, so check for errors on calling it only. $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); - $this->entity->postCreate($storage); + // Our mocked entity->postCreate() returns NULL, so assert that. + $this->assertNull($this->entity->postCreate($storage)); } /** @@ -584,7 +587,8 @@ class EntityUnitTest extends UnitTestCase { public function testPreDelete() { // This method is internal, so check for errors on calling it only. $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); - $this->entity->preDelete($storage, array($this->entity)); + // Our mocked entity->preDelete() returns NULL, so assert that. + $this->assertNull($this->entity->preDelete($storage, array($this->entity))); } /** @@ -617,7 +621,8 @@ class EntityUnitTest extends UnitTestCase { // This method is internal, so check for errors on calling it only. $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $entities = array($this->entity); - $this->entity->postLoad($storage, $entities); + // Our mocked entity->postLoad() returns NULL, so assert that. + $this->assertNull($this->entity->postLoad($storage, $entities)); } /** diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/AccessSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/AccessSubscriberTest.php index 11f35655eeb..46022ea7fcf 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/AccessSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/AccessSubscriberTest.php @@ -91,9 +91,9 @@ class AccessSubscriberTest extends UnitTestCase { } /** - * Tests access denied throws a Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException exception. + * Tests access denied throws an exception. * - * @expectedException Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException + * @expectedException \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException */ public function testAccessSubscriberThrowsAccessDeniedException() { @@ -132,25 +132,27 @@ class AccessSubscriberTest extends UnitTestCase { } /** - * Tests that if access is granted, AccessSubscriber will not throw a Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException exception. + * Tests that if access is granted, AccessSubscriber will not throw an exception. */ public function testAccessSubscriberDoesNotAlterRequestIfAccessManagerGrantsAccess() { - $this->parameterBag->expects($this->any()) + $this->parameterBag->expects($this->once()) ->method('has') ->with(RouteObjectInterface::ROUTE_OBJECT) ->will($this->returnValue(TRUE)); - $this->parameterBag->expects($this->any()) + $this->parameterBag->expects($this->once()) ->method('get') ->with(RouteObjectInterface::ROUTE_OBJECT) ->will($this->returnValue($this->route)); - $this->accessManager->expects($this->any()) + $this->accessManager->expects($this->once()) ->method('check') - ->with($this->anything()) + ->with($this->equalTo($this->route)) ->will($this->returnValue(TRUE)); $subscriber = new AccessSubscriber($this->accessManager, $this->currentUser); + // We're testing that no exception is thrown in this case. There is no + // return. $subscriber->onKernelRequestAccessCheck($this->event); } diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php index 57607a81b78..67dfce1acde 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php @@ -42,7 +42,8 @@ class ModuleRouteSubscriberTest extends UnitTestCase { /** * Tests that removeRoute() removes routes when the module is not enabled. * - * @dataProvider testRemoveRouteProvider + * @dataProvider providerTestRemoveRoute + * @covers ::onAlterRoutes * * @param string $route_name * The machine name for the route. @@ -71,7 +72,7 @@ class ModuleRouteSubscriberTest extends UnitTestCase { /** * Data provider for testRemoveRoute(). */ - public function testRemoveRouteProvider() { + public function providerTestRemoveRoute() { return array( array('enabled', array('_module_dependencies' => 'enabled'), FALSE), array('disabled', array('_module_dependencies' => 'disabled'), TRUE),