Permalink
Browse files

Fixing the DatabaseSuite file for phpunit 4.0

  • Loading branch information...
1 parent bd95c0f commit 1eaf49ec74fd469163ee74f244b9647962dd656e @lorenzo lorenzo committed Mar 10, 2014
Showing with 15 additions and 3 deletions.
  1. +15 −3 tests/TestCase/DatabaseSuite.php
@@ -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);
@@ -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.