Updating test manager test cases to reflect changes in API.

This commit is contained in:
Mark Story 2010-01-10 12:39:21 -05:00
parent a0aca7ee62
commit e304246e8f

View file

@ -19,7 +19,6 @@
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'TestManager');
/** /**
* TestManagerTest class * TestManagerTest class
@ -36,7 +35,7 @@ class TestManagerTest extends CakeTestCase {
* @access public * @access public
*/ */
function setUp() { function setUp() {
$this->Sut =& new TestManager(); $this->TestManager =& new TestManager();
$this->Reporter =& new CakeHtmlReporter(); $this->Reporter =& new CakeHtmlReporter();
} }
@ -47,12 +46,12 @@ class TestManagerTest extends CakeTestCase {
* @access public * @access public
*/ */
function testRunAllTests() { function testRunAllTests() {
$folder =& new Folder($this->Sut->_getTestsPath()); $folder =& new Folder($this->TestManager->_getTestsPath());
$extension = str_replace('.', '\.', TestManager::getExtension('test')); $extension = str_replace('.', '\.', $this->TestManager->getExtension('test'));
$out = $folder->findRecursive('.*' . $extension); $out = $folder->findRecursive('.*' . $extension);
$reporter =& new CakeHtmlReporter(); $reporter =& new CakeHtmlReporter();
$list = TestManager::runAllTests($reporter, true); $list = $this->TestManager->runAllTests($reporter, true);
$this->assertEqual(count($out), count($list)); $this->assertEqual(count($out), count($list));
} }
@ -65,12 +64,12 @@ class TestManagerTest extends CakeTestCase {
*/ */
function testRunTestCase() { function testRunTestCase() {
$file = md5(time()); $file = md5(time());
$result = $this->Sut->runTestCase($file, $this->Reporter); $result = $this->TestManager->runTestCase($file, $this->Reporter);
$this->assertError('Test case ' . $file . ' cannot be found'); $this->assertError('Test case ' . $file . ' cannot be found');
$this->assertFalse($result); $this->assertFalse($result);
$file = str_replace(CORE_TEST_CASES, '', __FILE__); $file = str_replace(CORE_TEST_CASES, '', __FILE__);
$result = $this->Sut->runTestCase($file, $this->Reporter, true); $result = $this->TestManager->runTestCase($file, $this->Reporter, true);
$this->assertTrue($result); $this->assertTrue($result);
} }