mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating schema shell test so it doesn't fail in groups.
Updating suites to use new method.
This commit is contained in:
parent
6124eb6f7a
commit
8e6277c9d1
5 changed files with 17 additions and 34 deletions
|
@ -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 @@ 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');
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue