2013-03-13 03:34:30 +00:00
|
|
|
<?php
|
2013-03-18 10:12:28 +00:00
|
|
|
/**
|
|
|
|
* CakeTestSuiteDispatcherTest file
|
|
|
|
*
|
|
|
|
* Test Case for CakeTestSuiteDispatcher class
|
|
|
|
*
|
|
|
|
* PHP version 5
|
|
|
|
*
|
|
|
|
* CakePHP : Rapid Development Framework (http://cakephp.org)
|
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* For full copyright and license information, please see the LICENSE.txt
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
|
* @link http://cakephp.org CakePHP Project
|
|
|
|
* @package Cake.Test.Case.TestSuite
|
|
|
|
* @since CakePHP v 2.3.2
|
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
|
|
|
*/
|
2013-03-13 03:34:30 +00:00
|
|
|
|
|
|
|
class CakeTestSuiteDispatcherTest extends CakeTestCase {
|
|
|
|
|
2013-03-18 10:38:50 +00:00
|
|
|
/**
|
|
|
|
* setUp method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-03-18 10:12:28 +00:00
|
|
|
public function setUp() {
|
|
|
|
$this->vendors = App::path('vendors');
|
|
|
|
$this->includePath = ini_get('include_path');
|
|
|
|
}
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:38:50 +00:00
|
|
|
/**
|
|
|
|
* tearDown method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-03-18 10:12:28 +00:00
|
|
|
public function tearDown() {
|
|
|
|
App::build(array('Vendor' => $this->vendors), App::RESET);
|
|
|
|
ini_set('include_path', $this->includePath);
|
|
|
|
}
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:38:50 +00:00
|
|
|
/**
|
|
|
|
* Helper method to set vendor path
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function _clearPaths() {
|
2013-03-18 10:12:28 +00:00
|
|
|
App::build(array('Vendor' => array('junk')), App::RESET);
|
|
|
|
ini_set('include_path', 'junk');
|
|
|
|
}
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:38:50 +00:00
|
|
|
/**
|
|
|
|
* testLoadTestFramework method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-03-18 10:12:28 +00:00
|
|
|
public function testLoadTestFramework() {
|
|
|
|
$dispatcher = new CakeTestSuiteDispatcher();
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:12:28 +00:00
|
|
|
$this->assertTrue($dispatcher->loadTestFramework());
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:38:50 +00:00
|
|
|
$this->_clearPaths();
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:38:50 +00:00
|
|
|
$this->setExpectedException('PHPUnit_Framework_Error_Warning');
|
|
|
|
$dispatcher->loadTestFramework();
|
2013-03-18 10:12:28 +00:00
|
|
|
}
|
2013-03-13 03:34:30 +00:00
|
|
|
|
2013-03-18 10:12:28 +00:00
|
|
|
}
|