diff --git a/core/phpunit.xml.dist b/core/phpunit.xml.dist index 6ca7e89..f7c97fc 100644 --- a/core/phpunit.xml.dist +++ b/core/phpunit.xml.dist @@ -1,6 +1,6 @@ - + ./tests/* diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php index b5caeeb..c37d240 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php @@ -57,6 +57,9 @@ function testCRUD() { * * We test two attacks: first changes the file mtime, then the directory * mtime too. + * + * We need to delay over 1 second for mtime test. + * @medium */ function testSecurity() { $php = $this->storageFactory->get('simpletest'); diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php index 6fcb055..907cf40 100644 --- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php @@ -152,7 +152,7 @@ function setUp() { * * @see testRender */ - function testRenderProvider() { + function providerTestRender() { // Default for 'browsers' key in CSS asset. $browsers_default = array('IE' => TRUE, '!IE' => TRUE); @@ -537,7 +537,7 @@ function testRenderProvider() { /** * Tests CSS asset rendering. * - * @dataProvider testRenderProvider + * @dataProvider providerTestRender */ function testRender(array $css_assets, array $render_elements) { $this->assertSame($render_elements, $this->renderer->render($css_assets)); diff --git a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php index a077ad5..2fbf619 100644 --- a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php @@ -86,7 +86,7 @@ function setUp() { /** * Provides data for the CSS asset optimizing test. */ - function testOptimizeProvider() { + function providerTestOptimize() { $path = dirname(__FILE__) . '/css_test_files/'; return array( // File. Tests: @@ -194,7 +194,7 @@ function testOptimizeProvider() { /** * Tests optimizing a CSS asset group containing 'type' => 'file'. * - * @dataProvider testOptimizeProvider + * @dataProvider providerTestOptimize */ function testOptimize($css_asset, $expected) { $this->assertEquals($expected, $this->optimizer->optimize($css_asset), 'Group of file CSS assets optimized correctly.'); diff --git a/core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php b/core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php index 9bf2c80..6877a9c 100644 --- a/core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php +++ b/core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php @@ -39,10 +39,11 @@ function testEmpty() { function testEmptyIteration() { $result = new StatementEmpty(); + $count = 0; foreach ($result as $record) { - $this->fail('Iterating empty result set should not iterate.'); - return; + $count++; } + $this->assertSame(0, $count, 'Iterating empty result set should not iterate.'); } /** diff --git a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerUnitTest.php b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerUnitTest.php index 45ad0d2..49ab1f8 100644 --- a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerUnitTest.php @@ -13,6 +13,7 @@ use Drupal\Core\Extension\ModuleHandler; use Drupal\Tests\UnitTestCase; +use PHPUnit_Framework_Error_Notice; /** * Tests the ModuleHandler class. @@ -34,9 +35,12 @@ function setUp() { $this->moduleHandler = new ModuleHandler; } - function testloadInclude() { - // Make sure that load include does not throw notices on nonexisiting - // modules. - $this->moduleHandler->loadInclude('foo', 'inc'); + /** + * Tests loading of an include from a nonexistent module. + */ + public function testLoadInclude() { + // Attepmting to load a file from a non-existent module should return FALSE. + $this->assertFalse($this->moduleHandler->loadInclude('foo', 'inc')); } + } diff --git a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php index 933f8b5..2ce4ef7 100644 --- a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php +++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php @@ -52,6 +52,9 @@ public function testWaitFalse() { /** * Tests the wait() method when lockMayBeAvailable() returns FALSE. + * + * Waiting could take 1 second so we need to extend the possible runtime. + * @medium */ public function testWaitTrue() { $this->lock->expects($this->any())