mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
"Adding additional test to show how to load files that do not follow directory naming or file naming conventions.
References #4319, References #4334" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6600 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
246095a97d
commit
d8d7b899a1
4 changed files with 108 additions and 0 deletions
|
@ -186,6 +186,24 @@ class AppImportTest extends UnitTestCase {
|
||||||
$result = App::import('Vendor', 'Sample');
|
$result = App::import('Vendor', 'Sample');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
$this->assertTrue(class_exists('SampleClassTestName'));
|
$this->assertTrue(class_exists('SampleClassTestName'));
|
||||||
|
|
||||||
|
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);
|
||||||
|
$this->assertEqual($text, 'This is the hello.php file in Test directoy');
|
||||||
|
|
||||||
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
30
cake/tests/test_app/vendors/Test/MyTest.php
vendored
Normal file
30
cake/tests/test_app/vendors/Test/MyTest.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
/**
|
||||||
|
* Short description for file.
|
||||||
|
*
|
||||||
|
* Long description for file
|
||||||
|
*
|
||||||
|
* PHP versions 4 and 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
|
* Las Vegas, Nevada 89104
|
||||||
|
*
|
||||||
|
* Licensed under The Open Group Test Suite License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @filesource
|
||||||
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.test_app.vendors.somename
|
||||||
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
* @version $Revision$
|
||||||
|
* @modifiedby $LastChangedBy$
|
||||||
|
* @lastmodified $Date$
|
||||||
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
This is the MyTest.php file
|
30
cake/tests/test_app/vendors/Test/hello.php
vendored
Normal file
30
cake/tests/test_app/vendors/Test/hello.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
/**
|
||||||
|
* Short description for file.
|
||||||
|
*
|
||||||
|
* Long description for file
|
||||||
|
*
|
||||||
|
* PHP versions 4 and 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
|
* Las Vegas, Nevada 89104
|
||||||
|
*
|
||||||
|
* Licensed under The Open Group Test Suite License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @filesource
|
||||||
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.test_app.vendors.Test
|
||||||
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
* @version $Revision$
|
||||||
|
* @modifiedby $LastChangedBy$
|
||||||
|
* @lastmodified $Date$
|
||||||
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
This is the hello.php file in Test directoy
|
30
cake/tests/test_app/vendors/somename/some.name.php
vendored
Normal file
30
cake/tests/test_app/vendors/somename/some.name.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
/**
|
||||||
|
* Short description for file.
|
||||||
|
*
|
||||||
|
* Long description for file
|
||||||
|
*
|
||||||
|
* PHP versions 4 and 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
|
* Las Vegas, Nevada 89104
|
||||||
|
*
|
||||||
|
* Licensed under The Open Group Test Suite License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @filesource
|
||||||
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
||||||
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
|
* @package cake.tests
|
||||||
|
* @subpackage cake.tests.test_app.vendors.somename
|
||||||
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
* @version $Revision$
|
||||||
|
* @modifiedby $LastChangedBy$
|
||||||
|
* @lastmodified $Date$
|
||||||
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
This is a file with dot in file name
|
Loading…
Add table
Reference in a new issue