Commit 1402c663 authored by alexpott's avatar alexpott

Issue #2096595 by neclimdul, damiankloip, tim.plunkett, Mile23, ParisLiakos:...

Issue #2096595 by neclimdul, damiankloip, tim.plunkett, Mile23, ParisLiakos: Make all PHPUnit tests pass with --strict.
parent cf8c025b
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php" colors="true">
<phpunit bootstrap="tests/bootstrap.php" colors="true" strict="true">
<testsuites>
<testsuite name="Drupal Unit Test Suite">
<directory>./tests/*</directory>
......
......@@ -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');
......
......@@ -153,7 +153,7 @@ function setUp() {
*
* @see testRender
*/
function testRenderProvider() {
function providerTestRender() {
// Default for 'browsers' key in CSS asset.
$browsers_default = array('IE' => TRUE, '!IE' => TRUE);
......@@ -538,7 +538,7 @@ function testRenderProvider() {
/**
* Tests CSS asset rendering.
*
* @dataProvider testRenderProvider
* @dataProvider providerTestRender
*/
function testRender(array $css_assets, array $render_elements) {
$this->state->expects($this->once())
......
......@@ -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.');
......
......@@ -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.');
}
/**
......
......@@ -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'));
}
}
......@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment