Browse files

more coding standards fixes, minor rectaoring of testcase

  • Loading branch information...
1 parent 89100f9 commit 99fba8c60184fe538e84245046596ff2063e527c @ceeram ceeram committed Mar 18, 2013
View
35 lib/Cake/Test/Case/TestSuite/CakeTestSuiteDispatcherTest.php
@@ -22,37 +22,50 @@
class CakeTestSuiteDispatcherTest extends CakeTestCase {
+/**
+ * setUp method
+ *
+ * @return void
+ */
public function setUp() {
$this->vendors = App::path('vendors');
$this->includePath = ini_get('include_path');
}
+/**
+ * tearDown method
+ *
+ * @return void
+ */
public function tearDown() {
App::build(array('Vendor' => $this->vendors), App::RESET);
ini_set('include_path', $this->includePath);
}
- protected function clearPaths() {
+/**
+ * Helper method to set vendor path
+ *
+ * @return void
+ */
+ protected function _clearPaths() {
App::build(array('Vendor' => array('junk')), App::RESET);
ini_set('include_path', 'junk');
}
+/**
+ * testLoadTestFramework method
+ *
+ * @return void
+ */
public function testLoadTestFramework() {
$dispatcher = new CakeTestSuiteDispatcher();
$this->assertTrue($dispatcher->loadTestFramework());
- $this->clearPaths();
-
- $exception = null;
-
- try {
- $dispatcher->loadTestFramework();
- } catch (Exception $ex) {
- $exception = $ex;
- }
+ $this->_clearPaths();
- $this->assertEquals(get_class($exception), "PHPUnit_Framework_Error_Warning");
+ $this->setExpectedException('PHPUnit_Framework_Error_Warning');
+ $dispatcher->loadTestFramework();
}
}
View
2 lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
@@ -138,7 +138,7 @@ protected function _checkPHPUnit() {
*/
public function loadTestFramework() {
foreach (App::path('vendors') as $vendor) {
- $vendor = rtrim($vendor, DS);
+ $vendor = rtrim($vendor, DS);
if (is_dir($vendor . DS . 'PHPUnit')) {
ini_set('include_path', $vendor . PATH_SEPARATOR . ini_get('include_path'));
break;

0 comments on commit 99fba8c

Please sign in to comment.