comparison cake/tests/cases/libs/test_manager.test.php @ 0:261e66bd5a0c

hg init
author Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
date Sun, 24 Jul 2011 21:08:31 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:261e66bd5a0c
1 <?php
2 /**
3 * TestManagerTest file
4 *
5 * PHP versions 4 and 5
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2010, Cake Software Foundation, Inc.
9 * 1785 E. Sahara Avenue, Suite 490-204
10 * Las Vegas, Nevada 89104
11 *
12 * Licensed under The Open Group Test Suite License
13 * Redistributions of files must retain the above copyright notice.
14 *
15 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
16 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
17 * @package cake
18 * @subpackage cake.tests.cases.libs
19 * @since CakePHP(tm) v 1.2.0.4206
20 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
21 */
22
23 /**
24 * TestManagerTest class
25 *
26 * @package cake
27 * @subpackage cake.tests.cases.libs
28 */
29 class TestManagerTest extends CakeTestCase {
30
31 /**
32 * setUp method
33 *
34 * @return void
35 * @access public
36 */
37 function setUp() {
38 $this->TestManager =& new TestManager();
39 $this->Reporter =& new CakeHtmlReporter();
40 }
41
42 /**
43 * testRunAllTests method
44 *
45 * @return void
46 * @access public
47 */
48 function testRunAllTests() {
49 $folder =& new Folder($this->TestManager->_getTestsPath());
50 $extension = str_replace('.', '\.', $this->TestManager->getExtension('test'));
51 $out = $folder->findRecursive('.*' . $extension);
52
53 $reporter =& new CakeHtmlReporter();
54 $list = $this->TestManager->runAllTests($reporter, true);
55
56 $this->assertEqual(count($out), count($list));
57 }
58
59 /**
60 * testRunTestCase method
61 *
62 * @return void
63 * @access public
64 */
65 function testRunTestCase() {
66 $file = md5(time());
67 $result = $this->TestManager->runTestCase($file, $this->Reporter);
68 $this->assertError('Test case ' . $file . ' cannot be found');
69 $this->assertFalse($result);
70
71 $file = str_replace(CORE_TEST_CASES, '', __FILE__);
72 $result = $this->TestManager->runTestCase($file, $this->Reporter, true);
73 $this->assertTrue($result);
74 }
75
76 /**
77 * testRunGroupTest method
78 *
79 * @return void
80 * @access public
81 */
82 function testRunGroupTest() {
83 }
84
85 /**
86 * testAddTestCasesFromDirectory method
87 *
88 * @return void
89 * @access public
90 */
91 function testAddTestCasesFromDirectory() {
92 }
93
94 /**
95 * testAddTestFile method
96 *
97 * @return void
98 * @access public
99 */
100 function testAddTestFile() {
101 }
102
103 /**
104 * testGetTestCaseList method
105 *
106 * @return void
107 * @access public
108 */
109 function testGetTestCaseList() {
110 }
111
112 /**
113 * testGetGroupTestList method
114 *
115 * @return void
116 * @access public
117 */
118 function testGetGroupTestList() {
119 }
120 }