Skip to content

Commit

Permalink
Fixing the DatabaseSuite file for phpunit 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 10, 2014
1 parent bd95c0f commit 1eaf49e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/TestCase/DatabaseSuite.php
Expand Up @@ -33,11 +33,19 @@ class DatabaseSuite extends TestSuite {
* @return void
*/
public static function suite() {
$suite = new TestSuite('Database related tests');
$suite = new self('Database related tests');
$suite->addTestDirectoryRecursive(__DIR__ . DS . 'Database');
$suite->addTestDirectoryRecursive(__DIR__ . DS . 'ORM');
$suite->addTestDirectoryRecursive(__DIR__ . DS . 'Model');
return $suite;
}

/**
* Returns an iterator for this test suite.
*
* @return ArrayIterator
*/
public function getIterator() {
$permutations = [
'Identifier Quoting' => function() {
ConnectionManager::get('test')->driver()->autoQuoting(true);
Expand All @@ -47,8 +55,12 @@ public static function suite() {
}
];

$suite = new TestPermutationDecorator($suite, $permutations);
return $suite;
$tests = [];
foreach (parent::getIterator() as $test) {
$tests[] = new TestPermutationDecorator($test, $permutations);
}

return new \ArrayIterator($tests);
}

}

0 comments on commit 1eaf49e

Please sign in to comment.