2008-11-07 11:33:13 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* TestManagerTest file
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* Long description for file
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
2009-11-06 04:34:28 +00:00
|
|
|
* Copyright 2005-2009, Cake Software Foundation, Inc.
|
2008-11-07 11:33:13 +00:00
|
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
|
|
* Las Vegas, Nevada 89104
|
|
|
|
*
|
|
|
|
* Licensed under The Open Group Test Suite License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2009-11-06 06:46:59 +00:00
|
|
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2009-03-19 21:10:13 +00:00
|
|
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs
|
|
|
|
* @since CakePHP(tm) v 1.2.0.4206
|
|
|
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
2008-11-07 11:33:13 +00:00
|
|
|
*/
|
|
|
|
App::import('Core', 'TestManager');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-03-19 21:10:13 +00:00
|
|
|
/**
|
|
|
|
* TestManagerTest class
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs
|
|
|
|
*/
|
2008-11-07 11:33:13 +00:00
|
|
|
class TestManagerTest extends CakeTestCase {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:47:59 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* setUp method
|
2008-11-07 11:47:59 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function setUp() {
|
2008-11-07 16:17:18 +00:00
|
|
|
$this->Sut =& new TestManager();
|
|
|
|
$this->Reporter =& new CakeHtmlReporter();
|
2008-11-07 11:47:59 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:47:59 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testRunAllTests method
|
2008-11-07 11:47:59 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
2008-11-07 11:33:13 +00:00
|
|
|
function testRunAllTests() {
|
2008-11-07 16:17:18 +00:00
|
|
|
$folder =& new Folder($this->Sut->_getTestsPath());
|
2008-11-07 11:47:59 +00:00
|
|
|
$extension = str_replace('.', '\.', TestManager::getExtension('test'));
|
2008-11-07 11:33:13 +00:00
|
|
|
$out = $folder->findRecursive('.*' . $extension);
|
|
|
|
|
2008-11-07 16:17:18 +00:00
|
|
|
$reporter =& new CakeHtmlReporter();
|
2008-11-07 11:33:13 +00:00
|
|
|
$list = TestManager::runAllTests($reporter, true);
|
|
|
|
|
2008-11-07 16:17:18 +00:00
|
|
|
$this->assertEqual(count($out), count($list));
|
2008-11-07 11:33:13 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:33:13 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testRunTestCase method
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function testRunTestCase() {
|
2008-11-07 11:47:59 +00:00
|
|
|
$file = md5(time());
|
|
|
|
$result = $this->Sut->runTestCase($file, $this->Reporter);
|
|
|
|
$this->assertError('Test case ' . $file . ' cannot be found');
|
|
|
|
$this->assertFalse($result);
|
2008-11-07 11:33:13 +00:00
|
|
|
|
2008-11-07 11:47:59 +00:00
|
|
|
$file = str_replace(CORE_TEST_CASES, '', __FILE__);
|
|
|
|
$result = $this->Sut->runTestCase($file, $this->Reporter, true);
|
|
|
|
$this->assertTrue($result);
|
2008-11-07 11:33:13 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:33:13 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testRunGroupTest method
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function testRunGroupTest() {
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:33:13 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testAddTestCasesFromDirectory method
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function testAddTestCasesFromDirectory() {
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:33:13 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testAddTestFile method
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function testAddTestFile() {
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:33:13 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testGetTestCaseList method
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function testGetTestCaseList() {
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-07 11:33:13 +00:00
|
|
|
/**
|
2009-03-19 21:10:13 +00:00
|
|
|
* testGetGroupTestList method
|
2008-11-07 11:33:13 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function testGetGroupTestList() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|