2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* ConfigureTest file
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* Holds several tests
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
2010-01-26 19:18:20 +00:00
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The Open Group Test Suite License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2010-01-26 19:18:20 +00:00
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-10-30 17:30:26 +00:00
|
|
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs
|
|
|
|
* @since CakePHP(tm) v 1.2.0.5432
|
|
|
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
App::import('Core', 'Configure');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* ConfigureTest
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2008-07-21 02:40:58 +00:00
|
|
|
class ConfigureTest extends CakeTestCase {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* setUp method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function setUp() {
|
2009-03-21 23:55:39 +00:00
|
|
|
$this->_cacheDisable = Configure::read('Cache.disable');
|
|
|
|
$this->_debug = Configure::read('debug');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-06-11 16:13:16 +00:00
|
|
|
Configure::write('Cache.disable', true);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-06-11 16:13:16 +00:00
|
|
|
/**
|
|
|
|
* endTest
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function endTest() {
|
|
|
|
App::build();
|
2009-07-24 19:18:37 +00:00
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* tearDown method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function tearDown() {
|
|
|
|
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_core_paths')) {
|
|
|
|
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_core_paths');
|
|
|
|
}
|
|
|
|
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_dir_map')) {
|
|
|
|
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_dir_map');
|
|
|
|
}
|
|
|
|
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_file_map')) {
|
|
|
|
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_file_map');
|
|
|
|
}
|
|
|
|
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_object_map')) {
|
|
|
|
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_object_map');
|
|
|
|
}
|
2008-10-15 17:30:08 +00:00
|
|
|
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'test.config.php')) {
|
|
|
|
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'test.config.php');
|
|
|
|
}
|
|
|
|
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'test.php')) {
|
|
|
|
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'test.php');
|
|
|
|
}
|
2009-03-21 23:55:39 +00:00
|
|
|
Configure::write('debug', $this->_debug);
|
|
|
|
Configure::write('Cache.disable', $this->_cacheDisable);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testRead method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testRead() {
|
|
|
|
$expected = 'ok';
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::write('level1.level2.level3_1', $expected);
|
|
|
|
Configure::write('level1.level2.level3_2', 'something_else');
|
|
|
|
$result = Configure::read('level1.level2.level3_1');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($expected, $result);
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('level1.level2.level3_2');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($result, 'something_else');
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('debug');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue($result >= 0);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testWrite method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testWrite() {
|
2010-03-03 23:20:15 +00:00
|
|
|
$writeResult = Configure::write('SomeName.someKey', 'myvalue');
|
|
|
|
$this->assertTrue($writeResult);
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('SomeName.someKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($result, 'myvalue');
|
|
|
|
|
2010-03-03 23:20:15 +00:00
|
|
|
$writeResult = Configure::write('SomeName.someKey', null);
|
|
|
|
$this->assertTrue($writeResult);
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('SomeName.someKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($result, null);
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-24 20:29:46 +00:00
|
|
|
$expected = array('One' => array('Two' => array('Three' => array('Four' => array('Five' => 'cool')))));
|
2010-03-03 23:20:15 +00:00
|
|
|
$writeResult = Configure::write('Key', $expected);
|
|
|
|
$this->assertTrue($writeResult);
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-24 20:29:46 +00:00
|
|
|
$result = Configure::read('Key');
|
|
|
|
$this->assertEqual($expected, $result);
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-24 20:29:46 +00:00
|
|
|
$result = Configure::read('Key.One');
|
|
|
|
$this->assertEqual($expected['One'], $result);
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-24 20:29:46 +00:00
|
|
|
$result = Configure::read('Key.One.Two');
|
|
|
|
$this->assertEqual($expected['One']['Two'], $result);
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-24 20:29:46 +00:00
|
|
|
$result = Configure::read('Key.One.Two.Three.Four.Five');
|
|
|
|
$this->assertEqual('cool', $result);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-13 14:04:28 +00:00
|
|
|
/**
|
|
|
|
* testSetErrorReporting Level
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2008-06-13 14:04:28 +00:00
|
|
|
function testSetErrorReportingLevel() {
|
2009-09-08 03:28:50 +00:00
|
|
|
Configure::write('log', false);
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::write('debug', 0);
|
2008-06-13 14:04:28 +00:00
|
|
|
$result = ini_get('error_reporting');
|
|
|
|
$this->assertEqual($result, 0);
|
2008-09-19 02:37:20 +00:00
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::write('debug', 2);
|
2008-06-13 14:04:28 +00:00
|
|
|
$result = ini_get('error_reporting');
|
2009-09-07 18:41:57 +00:00
|
|
|
$this->assertEqual($result, E_ALL & ~E_DEPRECATED);
|
2008-09-19 02:37:20 +00:00
|
|
|
|
2008-06-13 14:04:28 +00:00
|
|
|
$result = ini_get('display_errors');
|
|
|
|
$this->assertEqual($result, 1);
|
2008-09-19 02:37:20 +00:00
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::write('debug', 0);
|
2008-06-13 14:04:28 +00:00
|
|
|
$result = ini_get('error_reporting');
|
|
|
|
$this->assertEqual($result, 0);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-09-08 03:28:50 +00:00
|
|
|
/**
|
|
|
|
* test that log and debug configure values interact well.
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2009-09-08 03:28:50 +00:00
|
|
|
function testInteractionOfDebugAndLog() {
|
|
|
|
Configure::write('log', false);
|
|
|
|
|
|
|
|
Configure::write('debug', 0);
|
|
|
|
$this->assertEqual(ini_get('error_reporting'), 0);
|
|
|
|
$this->assertEqual(ini_get('display_errors'), 0);
|
|
|
|
|
|
|
|
Configure::write('log', E_WARNING);
|
|
|
|
Configure::write('debug', 0);
|
|
|
|
$this->assertEqual(ini_get('error_reporting'), E_WARNING);
|
|
|
|
$this->assertEqual(ini_get('display_errors'), 0);
|
|
|
|
|
|
|
|
Configure::write('debug', 2);
|
|
|
|
$this->assertEqual(ini_get('error_reporting'), E_ALL & ~E_DEPRECATED);
|
|
|
|
$this->assertEqual(ini_get('display_errors'), 1);
|
2009-12-11 05:46:13 +00:00
|
|
|
|
|
|
|
Configure::write('debug', 0);
|
|
|
|
Configure::write('log', false);
|
|
|
|
$this->assertEqual(ini_get('error_reporting'), 0);
|
|
|
|
$this->assertEqual(ini_get('display_errors'), 0);
|
2009-09-08 03:28:50 +00:00
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testDelete method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testDelete() {
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::write('SomeName.someKey', 'myvalue');
|
|
|
|
$result = Configure::read('SomeName.someKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($result, 'myvalue');
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::delete('SomeName.someKey');
|
|
|
|
$result = Configure::read('SomeName.someKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue($result === null);
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::write('SomeName', array('someKey' => 'myvalue', 'otherKey' => 'otherValue'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('SomeName.someKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($result, 'myvalue');
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('SomeName.otherKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual($result, 'otherValue');
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::delete('SomeName');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('SomeName.someKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue($result === null);
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::read('SomeName.otherKey');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue($result === null);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testLoad method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testLoad() {
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::load('non_existing_configuration_file');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertFalse($result);
|
|
|
|
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::load('config');
|
2010-03-03 23:20:15 +00:00
|
|
|
$this->assertTrue($result);
|
2010-01-07 02:26:52 +00:00
|
|
|
|
2009-11-25 18:41:19 +00:00
|
|
|
$result = Configure::load('../../index');
|
|
|
|
$this->assertFalse($result);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-11-15 21:59:19 +00:00
|
|
|
/**
|
|
|
|
* testLoad method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testLoadPlugin() {
|
|
|
|
App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true);
|
|
|
|
$result = Configure::load('test_plugin.load');
|
2010-03-03 23:20:15 +00:00
|
|
|
$this->assertTrue($result);
|
2009-11-15 21:59:19 +00:00
|
|
|
$expected = '/test_app/plugins/test_plugin/config/load.php';
|
|
|
|
$config = Configure::read('plugin_load');
|
|
|
|
$this->assertEqual($config, $expected);
|
|
|
|
|
|
|
|
$result = Configure::load('test_plugin.more.load');
|
2010-03-03 23:20:15 +00:00
|
|
|
$this->assertTrue($result);
|
2009-11-15 21:59:19 +00:00
|
|
|
$expected = '/test_app/plugins/test_plugin/config/more.load.php';
|
|
|
|
$config = Configure::read('plugin_more_load');
|
|
|
|
$this->assertEqual($config, $expected);
|
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testStore method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-10-15 17:30:08 +00:00
|
|
|
function testStoreAndLoad() {
|
|
|
|
Configure::write('Cache.disable', false);
|
|
|
|
|
2009-11-14 19:30:22 +00:00
|
|
|
$expected = array('data' => 'value with backslash \, \'singlequote\' and "doublequotes"');
|
2008-10-15 17:30:08 +00:00
|
|
|
Configure::store('SomeExample', 'test', $expected);
|
|
|
|
|
|
|
|
Configure::load('test');
|
|
|
|
$config = Configure::read('SomeExample');
|
|
|
|
$this->assertEqual($config, $expected);
|
|
|
|
|
2009-11-14 19:30:22 +00:00
|
|
|
$expected = array(
|
|
|
|
'data' => array('first' => 'value with backslash \, \'singlequote\' and "doublequotes"', 'second' => 'value2'),
|
|
|
|
'data2' => 'value'
|
|
|
|
);
|
2009-11-16 01:09:35 +00:00
|
|
|
Configure::store('AnotherExample', 'test_config', $expected);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2009-11-16 00:55:20 +00:00
|
|
|
Configure::load('test_config');
|
2008-10-15 17:30:08 +00:00
|
|
|
$config = Configure::read('AnotherExample');
|
|
|
|
$this->assertEqual($config, $expected);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testVersion method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testVersion() {
|
2008-10-15 17:30:08 +00:00
|
|
|
$result = Configure::version();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(version_compare($result, '1.2', '>='));
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* AppImportTest class
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.cases.libs
|
2008-06-02 19:22:55 +00:00
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
class AppImportTest extends UnitTestCase {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-06-07 22:24:10 +00:00
|
|
|
/**
|
2009-06-11 16:13:16 +00:00
|
|
|
* testBuild method
|
2009-06-07 22:24:10 +00:00
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testBuild() {
|
2009-06-11 16:13:16 +00:00
|
|
|
$old = App::path('models');
|
|
|
|
$expected = array(
|
|
|
|
APP . 'models' . DS,
|
|
|
|
APP,
|
|
|
|
ROOT . DS . LIBS . 'model' . DS
|
|
|
|
);
|
|
|
|
$this->assertEqual($expected, $old);
|
|
|
|
|
|
|
|
App::build(array('models' => array('/path/to/models/')));
|
|
|
|
|
|
|
|
$new = App::path('models');
|
|
|
|
|
|
|
|
$expected = array(
|
|
|
|
APP . 'models' . DS,
|
|
|
|
'/path/to/models/',
|
|
|
|
APP,
|
|
|
|
ROOT . DS . LIBS . 'model' . DS
|
|
|
|
);
|
|
|
|
$this->assertEqual($expected, $new);
|
|
|
|
|
|
|
|
App::build(); //reset defaults
|
|
|
|
$defaults = App::path('models');
|
|
|
|
$this->assertEqual($old, $defaults);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-06-11 16:13:16 +00:00
|
|
|
/**
|
|
|
|
* testBuildWithReset method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testBuildWithReset() {
|
|
|
|
$old = App::path('models');
|
|
|
|
$expected = array(
|
|
|
|
APP . 'models' . DS,
|
|
|
|
APP,
|
|
|
|
ROOT . DS . LIBS . 'model' . DS
|
|
|
|
);
|
|
|
|
$this->assertEqual($expected, $old);
|
|
|
|
|
|
|
|
App::build(array('models' => array('/path/to/models/')), true);
|
|
|
|
|
|
|
|
$new = App::path('models');
|
|
|
|
|
|
|
|
$expected = array(
|
|
|
|
'/path/to/models/'
|
|
|
|
);
|
|
|
|
$this->assertEqual($expected, $new);
|
|
|
|
|
|
|
|
App::build(); //reset defaults
|
|
|
|
$defaults = App::path('models');
|
|
|
|
$this->assertEqual($old, $defaults);
|
2009-06-10 23:13:39 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-06-10 23:13:39 +00:00
|
|
|
/**
|
2009-06-11 16:13:16 +00:00
|
|
|
* testCore method
|
2009-06-10 23:13:39 +00:00
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testCore() {
|
2009-06-11 16:13:16 +00:00
|
|
|
$model = App::core('models');
|
|
|
|
$this->assertEqual(array(ROOT . DS . LIBS . 'model' . DS), $model);
|
|
|
|
|
|
|
|
$view = App::core('views');
|
|
|
|
$this->assertEqual(array(ROOT . DS . LIBS . 'view' . DS), $view);
|
|
|
|
|
|
|
|
$controller = App::core('controllers');
|
|
|
|
$this->assertEqual(array(ROOT . DS . LIBS . 'controller' . DS), $controller);
|
|
|
|
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-06-10 23:13:39 +00:00
|
|
|
/**
|
|
|
|
* testListObjects method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testListObjects() {
|
|
|
|
$result = App::objects('class', TEST_CAKE_CORE_INCLUDE_PATH . 'libs');
|
|
|
|
$this->assertTrue(in_array('Xml', $result));
|
|
|
|
$this->assertTrue(in_array('Cache', $result));
|
|
|
|
$this->assertTrue(in_array('HttpSocket', $result));
|
|
|
|
|
|
|
|
$result = App::objects('behavior');
|
|
|
|
$this->assertTrue(in_array('Tree', $result));
|
|
|
|
|
|
|
|
$result = App::objects('controller');
|
|
|
|
$this->assertTrue(in_array('Pages', $result));
|
|
|
|
|
|
|
|
$result = App::objects('component');
|
|
|
|
$this->assertTrue(in_array('Auth', $result));
|
|
|
|
|
|
|
|
$result = App::objects('view');
|
|
|
|
$this->assertTrue(in_array('Media', $result));
|
|
|
|
|
|
|
|
$result = App::objects('helper');
|
|
|
|
$this->assertTrue(in_array('Html', $result));
|
|
|
|
|
|
|
|
$result = App::objects('model');
|
2009-06-11 16:13:16 +00:00
|
|
|
$notExpected = array('AppModel', 'ModelBehavior', 'ConnectionManager', 'DbAcl', 'Model', 'CakeSchema');
|
2009-06-10 23:13:39 +00:00
|
|
|
foreach ($notExpected as $class) {
|
|
|
|
$this->assertFalse(in_array($class, $result));
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = App::objects('file');
|
|
|
|
$this->assertFalse($result);
|
|
|
|
|
|
|
|
$result = App::objects('file', 'non_existing_configure');
|
|
|
|
$expected = array();
|
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
$result = App::objects('NonExistingType');
|
|
|
|
$this->assertFalse($result);
|
2010-01-07 02:26:52 +00:00
|
|
|
|
|
|
|
App::build(array(
|
|
|
|
'plugins' => array(
|
|
|
|
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS
|
|
|
|
)
|
|
|
|
));
|
|
|
|
$result = App::objects('plugin', null, false);
|
|
|
|
$this->assertTrue(in_array('Cache', $result));
|
|
|
|
$this->assertTrue(in_array('Log', $result));
|
|
|
|
|
|
|
|
App::build();
|
2009-06-11 16:13:16 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-11-15 21:38:02 +00:00
|
|
|
/**
|
|
|
|
* test that pluginPath can find paths for plugins.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testPluginPath() {
|
|
|
|
App::build(array(
|
|
|
|
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
|
|
|
));
|
|
|
|
$path = App::pluginPath('test_plugin');
|
|
|
|
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
|
|
|
|
$this->assertEqual($path, $expected);
|
|
|
|
|
|
|
|
$path = App::pluginPath('TestPlugin');
|
|
|
|
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
|
|
|
|
$this->assertEqual($path, $expected);
|
|
|
|
|
|
|
|
$path = App::pluginPath('TestPluginTwo');
|
|
|
|
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS;
|
|
|
|
$this->assertEqual($path, $expected);
|
|
|
|
App::build();
|
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testClassLoading method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testClassLoading() {
|
|
|
|
$file = App::import();
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
2009-07-25 23:39:09 +00:00
|
|
|
$file = App::import('Model', 'Model', false);
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('Model'));
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-25 23:39:09 +00:00
|
|
|
$file = App::import('Controller', 'Controller', false);
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('Controller'));
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-25 23:39:09 +00:00
|
|
|
$file = App::import('Component', 'Component', false);
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('Component'));
|
2009-07-26 01:27:02 +00:00
|
|
|
|
2009-07-25 23:39:09 +00:00
|
|
|
$file = App::import('Shell', 'Shell', false);
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('Shell'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$file = App::import('Model', 'SomeRandomModelThatDoesNotExist', false);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
|
|
|
|
$file = App::import('Model', 'AppModel', false);
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('AppModel'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$file = App::import('WrongType', null, true, array(), '');
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$file = App::import('Model', 'NonExistingPlugin.NonExistingModel', false);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
|
|
|
|
$file = App::import('Core', 'NonExistingPlugin.NonExistingModel', false);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
|
|
|
|
$file = App::import('Model', array('NonExistingPlugin.NonExistingModel'), false);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
|
|
|
|
$file = App::import('Core', array('NonExistingPlugin.NonExistingModel'), false);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
|
|
|
|
$file = App::import('Core', array('NonExistingPlugin.NonExistingModel.AnotherChild'), false);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
|
|
|
|
if (!class_exists('AppController')) {
|
|
|
|
$classes = array_flip(get_declared_classes());
|
|
|
|
|
|
|
|
if (PHP5) {
|
|
|
|
$this->assertFalse(isset($classes['PagesController']));
|
|
|
|
$this->assertFalse(isset($classes['AppController']));
|
|
|
|
} else {
|
|
|
|
$this->assertFalse(isset($classes['pagescontroller']));
|
|
|
|
$this->assertFalse(isset($classes['appcontroller']));
|
|
|
|
}
|
|
|
|
|
|
|
|
$file = App::import('Controller', 'Pages');
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('PagesController'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$classes = array_flip(get_declared_classes());
|
|
|
|
|
|
|
|
if (PHP5) {
|
|
|
|
$this->assertTrue(isset($classes['PagesController']));
|
|
|
|
$this->assertTrue(isset($classes['AppController']));
|
|
|
|
} else {
|
|
|
|
$this->assertTrue(isset($classes['pagescontroller']));
|
|
|
|
$this->assertTrue(isset($classes['appcontroller']));
|
|
|
|
}
|
|
|
|
|
|
|
|
$file = App::import('Behavior', 'Containable');
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('ContainableBehavior'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$file = App::import('Component', 'RequestHandler');
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('RequestHandlerComponent'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$file = App::import('Helper', 'Form');
|
|
|
|
$this->assertTrue($file);
|
2009-09-24 03:09:15 +00:00
|
|
|
$this->assertTrue(class_exists('FormHelper'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$file = App::import('Model', 'NonExistingModel');
|
|
|
|
$this->assertFalse($file);
|
2009-09-24 03:12:22 +00:00
|
|
|
|
|
|
|
$file = App::import('Datasource', 'DboSource');
|
|
|
|
$this->assertTrue($file);
|
|
|
|
$this->assertTrue(class_exists('DboSource'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2008-09-19 02:37:20 +00:00
|
|
|
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build(array(
|
2009-10-21 14:13:14 +00:00
|
|
|
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
|
2009-06-11 16:13:16 +00:00
|
|
|
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
|
|
|
));
|
2008-07-21 02:40:58 +00:00
|
|
|
|
|
|
|
$result = App::import('Controller', 'TestPlugin.Tests');
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertTrue(class_exists('TestPluginAppController'));
|
2008-07-24 02:19:05 +00:00
|
|
|
$this->assertTrue(class_exists('TestsController'));
|
2008-09-19 02:37:20 +00:00
|
|
|
|
2009-10-21 10:59:12 +00:00
|
|
|
$result = App::import('Lib', 'TestPlugin.TestPluginLibrary');
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertTrue(class_exists('TestPluginLibrary'));
|
2009-10-21 14:13:14 +00:00
|
|
|
|
|
|
|
$result = App::import('Lib', 'Library');
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertTrue(class_exists('Library'));
|
|
|
|
|
2008-07-21 02:40:58 +00:00
|
|
|
$result = App::import('Helper', 'TestPlugin.OtherHelper');
|
|
|
|
$this->assertTrue($result);
|
2008-07-24 02:19:05 +00:00
|
|
|
$this->assertTrue(class_exists('OtherHelperHelper'));
|
2008-09-19 02:37:20 +00:00
|
|
|
|
2009-09-24 03:12:22 +00:00
|
|
|
$result = App::import('Datasource', 'TestPlugin.TestSource');
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertTrue(class_exists('TestSource'));
|
|
|
|
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testFileLoading method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testFileLoading () {
|
|
|
|
$file = App::import('File', 'RealFile', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php');
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$file = App::import('File', 'NoFile', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'cake' . DS . 'config.php');
|
|
|
|
$this->assertFalse($file);
|
|
|
|
}
|
|
|
|
// import($type = null, $name = null, $parent = true, $file = null, $search = array(), $return = false) {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testFileLoadingWithArray method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testFileLoadingWithArray() {
|
|
|
|
$type = array('type' => 'File', 'name' => 'SomeName', 'parent' => false,
|
|
|
|
'file' => TEST_CAKE_CORE_INCLUDE_PATH . DS . 'config' . DS . 'config.php');
|
|
|
|
$file = App::import($type);
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$type = array('type' => 'File', 'name' => 'NoFile', 'parent' => false,
|
|
|
|
'file' => TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'cake' . DS . 'config.php');
|
|
|
|
$file = App::import($type);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testFileLoadingReturnValue method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testFileLoadingReturnValue () {
|
|
|
|
$file = App::import('File', 'Name', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', true);
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$this->assertTrue(isset($file['Cake.version']));
|
|
|
|
|
|
|
|
$type = array('type' => 'File', 'name' => 'OtherName', 'parent' => false,
|
|
|
|
'file' => TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', 'return' => true);
|
|
|
|
$file = App::import($type);
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$this->assertTrue(isset($file['Cake.version']));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testLoadingWithSearch method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testLoadingWithSearch () {
|
|
|
|
$file = App::import('File', 'NewName', false, array(TEST_CAKE_CORE_INCLUDE_PATH ), 'config.php');
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$file = App::import('File', 'AnotherNewName', false, array(LIBS), 'config.php');
|
|
|
|
$this->assertFalse($file);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testLoadingWithSearchArray method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testLoadingWithSearchArray () {
|
|
|
|
$type = array('type' => 'File', 'name' => 'RandomName', 'parent' => false, 'file' => 'config.php', 'search' => array(TEST_CAKE_CORE_INCLUDE_PATH ));
|
|
|
|
$file = App::import($type);
|
|
|
|
$this->assertTrue($file);
|
|
|
|
|
|
|
|
$type = array('type' => 'File', 'name' => 'AnotherRandomName', 'parent' => false, 'file' => 'config.php', 'search' => array(LIBS));
|
|
|
|
$file = App::import($type);
|
|
|
|
$this->assertFalse($file);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testMultipleLoading method
|
2008-09-19 02:37:20 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMultipleLoading() {
|
2009-03-15 20:52:27 +00:00
|
|
|
$toLoad = array('I18n', 'CakeSocket');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$classes = array_flip(get_declared_classes());
|
|
|
|
$this->assertFalse(isset($classes['i18n']));
|
2009-03-15 20:52:27 +00:00
|
|
|
$this->assertFalse(isset($classes['CakeSocket']));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$load = App::import($toLoad);
|
|
|
|
$this->assertTrue($load);
|
|
|
|
|
|
|
|
$classes = array_flip(get_declared_classes());
|
|
|
|
|
|
|
|
if (PHP5) {
|
|
|
|
$this->assertTrue(isset($classes['I18n']));
|
|
|
|
} else {
|
|
|
|
$this->assertTrue(isset($classes['i18n']));
|
|
|
|
}
|
|
|
|
|
2009-03-15 20:52:27 +00:00
|
|
|
$load = App::import(array('I18n', 'SomeNotFoundClass', 'CakeSocket'));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertFalse($load);
|
|
|
|
|
|
|
|
$load = App::import($toLoad);
|
|
|
|
$this->assertTrue($load);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* This test only works if you have plugins/my_plugin set up.
|
|
|
|
* plugins/my_plugin/models/my_plugin.php and other_model.php
|
|
|
|
*/
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/*
|
|
|
|
function testMultipleLoadingByType() {
|
|
|
|
$classes = array_flip(get_declared_classes());
|
|
|
|
$this->assertFalse(isset($classes['OtherPlugin']));
|
|
|
|
$this->assertFalse(isset($classes['MyPlugin']));
|
|
|
|
|
|
|
|
|
|
|
|
$load = App::import('Model', array('MyPlugin.OtherPlugin', 'MyPlugin.MyPlugin'));
|
|
|
|
$this->assertTrue($load);
|
|
|
|
|
|
|
|
$classes = array_flip(get_declared_classes());
|
|
|
|
$this->assertTrue(isset($classes['OtherPlugin']));
|
|
|
|
$this->assertTrue(isset($classes['MyPlugin']));
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
function testLoadingVendor() {
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build(array(
|
|
|
|
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
|
|
|
'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
|
|
|
|
), true);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'TestPlugin.TestPluginAsset', array('ext' => 'css'));
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertEqual($text, 'this is the test plugin asset css file');
|
|
|
|
|
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'TestAsset', array('ext' => 'css'));
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertEqual($text, 'this is the test asset css file');
|
|
|
|
|
|
|
|
$result = App::import('Vendor', 'TestPlugin.SamplePlugin');
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertTrue(class_exists('SamplePluginClassTestName'));
|
|
|
|
|
2008-12-17 04:14:34 +00:00
|
|
|
$result = App::import('Vendor', 'ConfigureTestVendorSample');
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue($result);
|
2008-12-17 04:14:34 +00:00
|
|
|
$this->assertTrue(class_exists('ConfigureTestVendorSample'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'SomeName', array('file' => 'some.name.php'));
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertEqual($text, 'This is a file with dot in file name');
|
|
|
|
|
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'TestHello', array('file' => 'Test'.DS.'hello.php'));
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
2008-11-08 02:58:37 +00:00
|
|
|
$this->assertEqual($text, 'This is the hello.php file in Test directory');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'MyTest', array('file' => 'Test'.DS.'MyTest.php'));
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
|
|
|
$this->assertEqual($text, 'This is the MyTest.php file');
|
2008-09-19 02:37:20 +00:00
|
|
|
|
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'Welcome');
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
2008-11-08 02:58:37 +00:00
|
|
|
$this->assertEqual($text, 'This is the welcome.php file in vendors directory');
|
2008-09-19 02:37:20 +00:00
|
|
|
|
|
|
|
ob_start();
|
|
|
|
$result = App::import('Vendor', 'TestPlugin.Welcome');
|
|
|
|
$text = ob_get_clean();
|
|
|
|
$this->assertTrue($result);
|
2008-11-08 02:58:37 +00:00
|
|
|
$this->assertEqual($text, 'This is the welcome.php file in test_plugin/vendors directory');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
2008-06-27 08:17:02 +00:00
|
|
|
?>
|