Skip to content

Commit 26057c5

Browse files
committed
Fixing issue in DboSource test case where buffer would eat all the output.
Removing dead tests from TestManager test.
1 parent cd7bc3f commit 26057c5

File tree

3 files changed

+14
-59
lines changed

3 files changed

+14
-59
lines changed

cake/tests/cases/libs/model/datasources/dbo_source.test.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4154,18 +4154,21 @@ function testLog() {
41544154
$oldDebug = Configure::read('debug');
41554155
Configure::write('debug', 2);
41564156

4157-
$this->testDb->error = true;
4158-
$this->expectError();
4159-
ob_start();
4160-
$this->testDb->showQuery('Error 2');
4161-
$contents = ob_get_clean();
4162-
4163-
$this->assertPattern('/Error 2/s', $contents);
4164-
41654157
$this->testDb->error = $oldError;
41664158
Configure::write('debug', $oldDebug);
41674159
}
41684160

4161+
function testShowQueryError() {
4162+
$this->testDb->error = true;
4163+
try {
4164+
$this->testDb->showQuery('Error 2');
4165+
$this->fail('No exception');
4166+
} catch (Exception $e) {
4167+
$this->assertPattern('/SQL Error/', $e->getMessage());
4168+
$this->assertTrue(true, 'Exception thrown');
4169+
}
4170+
}
4171+
41694172
/**
41704173
* test getting the query log as an array.
41714174
*

cake/tests/cases/libs/test_manager.test.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,6 @@ protected function _getAllTestFiles($directory = CORE_TEST_CASES, $type = 'test'
8787
return $files;
8888
}
8989

90-
/**
91-
* testRunAllTests method
92-
*
93-
* @return void
94-
*/
95-
public function testRunAllTests() {
96-
$this->Reporter->params = array('show' => 'cases');
97-
$files = $this->_getAllTestFiles();
98-
$result = $this->TestManager->runAllTests($this->Reporter, true);
99-
100-
$this->assertEquals(count($files), $this->_countFiles);
101-
$this->assertType('PHPUnit_Framework_TestResult', $result);
102-
}
103-
10490
/**
10591
* Tests that trying to run an unexistent file throws an exception
10692
* @expectedException InvalidArgumentException
@@ -122,40 +108,4 @@ public function testRunTestCase() {
122108
$this->assertType('PHPUnit_Framework_TestResult', $result);
123109
}
124110

125-
/**
126-
* testAddTestCasesFromDirectory method
127-
*
128-
* @return void
129-
*/
130-
public function testAddTestCasesFromDirectory() {
131-
$this->TestManager->addTestCasesFromDirectory($this->testSuiteStub, CORE_TEST_CASES);
132-
$this->assertEquals(count($this->_getAllTestFiles()), $this->_countFiles);
133-
}
134-
135-
/**
136-
* testAddTestFile method
137-
*
138-
* @return void
139-
*/
140-
public function testAddTestFile() {
141-
$file = str_replace(CORE_TEST_CASES, '', __FILE__);
142-
$this->TestManager->addTestFile($this->testSuiteStub, $file);
143-
$this->assertEquals(1, $this->_countFiles);
144-
}
145-
146-
/**
147-
* testGetTestCaseList method
148-
*
149-
* @return void
150-
*/
151-
public function testGetTestCaseList() {
152-
}
153-
154-
/**
155-
* testGetGroupTestList method
156-
*
157-
* @return void
158-
*/
159-
public function testGetGroupTestList() {
160-
}
161111
}

cake/tests/lib/cake_test_suite.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public function addTestDirectoryRecursive($directory = '.') {
7474

7575
/**
7676
* Method that is called before the tests of this test suite are run.
77-
* It will load fixtures accordingly for each test
77+
* It will load fixtures accordingly for each test.
78+
*
7879
* @return void
7980
* @access protected
8081
*/
@@ -92,6 +93,7 @@ protected function setUp() {
9293

9394
/**
9495
* Method that is called after all the tests of this test suite are run.
96+
*
9597
* @return void
9698
* @access protected
9799
*/

0 commit comments

Comments
 (0)