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

Updating suites to use new method.
This commit is contained in:
mark_story 2010-09-25 00:13:37 -04:00
parent 6124eb6f7a
commit 8e6277c9d1
5 changed files with 17 additions and 34 deletions

View file

@ -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;
}
}

View file

@ -399,6 +399,11 @@ class SchemaShellTest extends CakeTestCase {
* @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 @@ class SchemaShellTest extends CakeTestCase {
$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');
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}