Permalink
Browse files

Added test for CakeTestSuiteDispatcher::loadTestFramework.

  • Loading branch information...
1 parent 5038e7e commit 294dff7a2644134b3a65240104a801885324e91e @psparrow psparrow committed Mar 13, 2013
Showing with 38 additions and 0 deletions.
  1. +38 −0 lib/Cake/Test/Case/TestSuite/CakeTestSuiteDispatcherTest.php
@@ -0,0 +1,38 @@
+<?php
+
+class CakeTestSuiteDispatcherTest extends CakeTestCase {
+
+ public function setUp() {
+ $this->vendors = App::path('vendors');
+ $this->includePath = ini_get('include_path');
+ }
+
+ public function tearDown() {
+ App::build(array('Vendor' => $this->vendors), App::RESET);
+ ini_set('include_path', $this->includePath);
+ }
+
+ protected function clearPaths() {
+ App::build(array('Vendor' => array('junk')), App::RESET);
+ ini_set('include_path', 'junk');
+ }
+
+ public function testLoadTestFramework() {
+ $dispatcher = new CakeTestSuiteDispatcher();
+
+ $this->assertTrue($dispatcher->loadTestFramework());
+
+ $this->clearPaths();
+
+ $exception = null;
+
+ try {
+ $dispatcher->loadTestFramework();
+ } catch(Exception $ex) {
+ $exception = $ex;
+ }
+
+ $this->assertEquals(get_class($exception), "PHPUnit_Framework_Error_Warning");
+ }
+
+}

0 comments on commit 294dff7

Please sign in to comment.