Skip to content
Permalink
Browse files

Updating schema shell test so it doesn't fail in groups.

Updating suites to use new method.
  • Loading branch information...
markstory committed Sep 25, 2010
1 parent 6124eb6 commit 8e6277c9d1a64a3446f5f82d606324582abe90ae
@@ -34,16 +34,13 @@ class AllShellsTest extends PHPUnit_Framework_TestSuite {
* @return void
*/
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('All shell classes');
$suite = new CakeTestSuite('All shell classes');
$path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS;
$suite->addTestFile(CORE_TEST_CASES . DS . 'console' . DS . 'cake.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'console' . DS . 'console_error_handler.test.php');
$tasks = array('schema', 'acl', 'api', 'bake', 'shell');
foreach ($tasks as $task) {
$suite->addTestFile($path . $task . '.test.php');
}
$suite->addTestDirectory($path);
return $suite;
}
}
@@ -399,6 +399,11 @@ public function testCreateNoArgs() {
* @return void
*/
public function testCreateWithTableArgs() {
$db = ConnectionManager::getDataSource('test');
$sources = $db->listSources();
if (in_array('acos', $sources)) {
$this->markTestSkipped('acos table already exists, cannot try to create it again.');
}
$this->Shell->params = array(
'connection' => 'test',
'name' => 'DbAcl',
@@ -409,11 +414,11 @@ public function testCreateWithTableArgs() {
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
$this->Shell->create();
$db =& ConnectionManager::getDataSource('test');
$db = ConnectionManager::getDataSource('test');
$sources = $db->listSources();
$this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources));
$this->assertFalse(in_array($db->config['prefix'] . 'aros', $sources));
$this->assertFalse(in_array('aros_acos', $sources));
$this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources), 'acos should be present.');
$this->assertFalse(in_array($db->config['prefix'] . 'aros', $sources), 'aros should not be found.');
$this->assertFalse(in_array('aros_acos', $sources), 'aros_acos should not be found.');
$db->execute('DROP TABLE ' . $db->config['prefix'] . 'acos');
}
@@ -34,16 +34,10 @@ class AllCacheEnginesTest extends PHPUnit_Framework_TestSuite {
* @return void
*/
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('All Cache related class tests');
$suite = new CakeTestSuite('All Cache related class tests');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cache.test.php');
$cacheIterator = new DirectoryIterator(CORE_TEST_CASES . DS . 'libs' . DS . 'cache');
foreach ($cacheIterator as $i => $file) {
if (!$file->isDot()) {
$suite->addTestfile($file->getPathname());
}
}
$suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'cache');
return $suite;
}
}
@@ -34,17 +34,11 @@ class AllComponentsTest extends PHPUnit_Framework_TestSuite {
* @return void
*/
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('All component class tests');
$suite = new CakeTestSuite('All component class tests');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component_collection.test.php');
$iterator = new DirectoryIterator(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components');
foreach ($iterator as $i => $file) {
if (!$file->isDot()) {
$suite->addTestfile($file->getPathname());
}
}
$suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components');
return $suite;
}
}
@@ -35,18 +35,11 @@ class AllHelpersTest extends PHPUnit_Framework_TestSuite {
* @return void
*/
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('All Helper tests');
$suite = new CakeTestSuite('All Helper tests');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helper.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helper_collection.test.php');
$helperIterator = new DirectoryIterator(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS);
foreach ($helperIterator as $i => $file) {
if (!$file->isDot()) {
$suite->addTestfile($file->getPathname());
}
}
$suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS);
return $suite;
}
}

0 comments on commit 8e6277c

Please sign in to comment.
You can’t perform that action at this time.