mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Moving console and database groups to PHPUnit.
Both have some fails caused by the current fixture implementation. Removing groups folder as its no longer used.
This commit is contained in:
parent
052f64b6cd
commit
c084456a08
5 changed files with 95 additions and 184 deletions
48
cake/tests/cases/console/all_shells.test.php
Normal file
48
cake/tests/cases/console/all_shells.test.php
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AllShellsTest file
|
||||||
|
*
|
||||||
|
* PHP 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
*
|
||||||
|
* Licensed under The MIT License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.cases
|
||||||
|
* @since CakePHP(tm) v 2.0
|
||||||
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AllShellsTest class
|
||||||
|
*
|
||||||
|
* This test group will run all top level shell classes.
|
||||||
|
*
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.cases.console
|
||||||
|
*/
|
||||||
|
class AllShellsTest extends PHPUnit_Framework_TestSuite {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* suite method, defines tests for this suite.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function suite() {
|
||||||
|
$suite = new PHPUnit_Framework_TestSuite('All shell classes');
|
||||||
|
|
||||||
|
$path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS;
|
||||||
|
|
||||||
|
$suite->addTestFile(CORE_TEST_CASES . DS . 'console' . DS . 'cake.test.php');
|
||||||
|
$tasks = array('acl', 'api', 'bake', 'schema', 'shell');
|
||||||
|
foreach ($tasks as $task) {
|
||||||
|
$suite->addTestFile($path . $task . '.test.php');
|
||||||
|
}
|
||||||
|
return $suite;
|
||||||
|
}
|
||||||
|
}
|
47
cake/tests/cases/libs/all_database.test.php
Normal file
47
cake/tests/cases/libs/all_database.test.php
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AllDatabaseTest file
|
||||||
|
*
|
||||||
|
* PHP 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
*
|
||||||
|
* Licensed under The MIT License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.cases
|
||||||
|
* @since CakePHP(tm) v 2.0
|
||||||
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AllDatabaseTest class
|
||||||
|
*
|
||||||
|
* This test group will run database tests not in model or behavior group.
|
||||||
|
*
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.groups
|
||||||
|
*/
|
||||||
|
class AllDatabaseTest extends PHPUnit_Framework_TestSuite {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* suite method, defines tests for this suite.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function suite() {
|
||||||
|
$suite = new PHPUnit_Framework_TestSuite('Datasources, Schema and DbAcl tests');
|
||||||
|
|
||||||
|
$path = CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS;
|
||||||
|
|
||||||
|
$tasks = array('db_acl', 'cake_schema', 'connection_manager', 'datasources' . DS . 'dbo_source');
|
||||||
|
foreach ($tasks as $task) {
|
||||||
|
$suite->addTestFile($path . $task . '.test.php');
|
||||||
|
}
|
||||||
|
return $suite;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,65 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* ConsoleGroupTest file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
|
||||||
*
|
|
||||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
|
||||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The Open Group Test Suite License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.groups
|
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ConsoleGroupTest class
|
|
||||||
*
|
|
||||||
* This test group will run all console tests
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.groups
|
|
||||||
*/
|
|
||||||
class ConsoleGroupTest extends TestSuite {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* label property
|
|
||||||
*
|
|
||||||
* @var string 'All core cache engines'
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $label = 'ShellDispatcher, Shell and all Tasks';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ConsoleGroupTest method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function ConsoleGroupTest() {
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'cake');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'acl');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'api');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'bake');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'schema');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'shell');
|
|
||||||
|
|
||||||
$path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'tasks' . DS;
|
|
||||||
|
|
||||||
TestManager::addTestFile($this, $path . 'controller');
|
|
||||||
TestManager::addTestFile($this, $path . 'db_config');
|
|
||||||
TestManager::addTestFile($this, $path . 'extract');
|
|
||||||
TestManager::addTestFile($this, $path . 'fixture');
|
|
||||||
TestManager::addTestFile($this, $path . 'model');
|
|
||||||
TestManager::addTestFile($this, $path . 'plugin');
|
|
||||||
TestManager::addTestFile($this, $path . 'project');
|
|
||||||
TestManager::addTestFile($this, $path . 'test');
|
|
||||||
TestManager::addTestFile($this, $path . 'view');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* DatabaseGroupTest file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
|
||||||
*
|
|
||||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
|
||||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The Open Group Test Suite License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.groups
|
|
||||||
* @since CakePHP(tm) v 1.2.0.5517
|
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DatabaseGroupTest class
|
|
||||||
*
|
|
||||||
* This test group will run all behavior, schema and datasource tests excluding database
|
|
||||||
* driver-specific tests
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.groups
|
|
||||||
*/
|
|
||||||
class DatabaseGroupTest extends TestSuite {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* label property
|
|
||||||
*
|
|
||||||
* @var string 'All model tests'
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $label = 'Datasources, Schema and DbAcl tests';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ModelGroupTest method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function DatabaseGroupTest() {
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'db_acl');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'cake_schema');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'connection_manager');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'datasources' . DS . 'dbo_source');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* NoCrossContaminationGroupTest file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
|
||||||
*
|
|
||||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
|
||||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The Open Group Test Suite License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.groups
|
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NoCrossContaminationGroupTest class
|
|
||||||
*
|
|
||||||
* This test group will run all tests
|
|
||||||
* that are proper isolated to be run in sequence
|
|
||||||
* without affected each other
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.groups
|
|
||||||
*/
|
|
||||||
class NoCrossContaminationGroupTest extends TestSuite {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* label property
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $label = 'No Cross Contamination';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* blacklist property
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $blacklist = array('cake_test_case.test.php', 'object.test.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NoCrossContaminationGroupTest method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function NoCrossContaminationGroupTest() {
|
|
||||||
App::import('Core', 'Folder');
|
|
||||||
|
|
||||||
$Folder = new Folder(CORE_TEST_CASES);
|
|
||||||
|
|
||||||
foreach ($Folder->findRecursive('.*\.test\.php', true) as $file) {
|
|
||||||
if (in_array(basename($file), $this->blacklist)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
TestManager::addTestFile($this, $file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue