mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Fixing CakeSchema to test APP_DIR with different names than all lowercase
This commit is contained in:
parent
6bb29ea03b
commit
110536d575
1 changed files with 13 additions and 1 deletions
|
@ -510,12 +510,24 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testSchemaName() {
|
public function testSchemaName() {
|
||||||
$Schema = new CakeSchema();
|
$Schema = new CakeSchema();
|
||||||
$this->assertEquals(strtolower(APP_DIR), strtolower($Schema->name));
|
$this->assertEquals(Inflector::camelize(Inflector::slug(APP_DIR)), $Schema->name);
|
||||||
|
|
||||||
Configure::write('App.dir', 'Some.name.with.dots');
|
Configure::write('App.dir', 'Some.name.with.dots');
|
||||||
$Schema = new CakeSchema();
|
$Schema = new CakeSchema();
|
||||||
$this->assertEquals('SomeNameWithDots', $Schema->name);
|
$this->assertEquals('SomeNameWithDots', $Schema->name);
|
||||||
|
|
||||||
|
Configure::write('App.dir', 'Some-name-with-dashes');
|
||||||
|
$Schema = new CakeSchema();
|
||||||
|
$this->assertEquals('SomeNameWithDashes', $Schema->name);
|
||||||
|
|
||||||
|
Configure::write('App.dir', 'Some name with spaces');
|
||||||
|
$Schema = new CakeSchema();
|
||||||
|
$this->assertEquals('SomeNameWithSpaces', $Schema->name);
|
||||||
|
|
||||||
|
Configure::write('App.dir', 'Some,name;with&weird=characters');
|
||||||
|
$Schema = new CakeSchema();
|
||||||
|
$this->assertEquals('SomeNameWithWeirdCharacters', $Schema->name);
|
||||||
|
|
||||||
Configure::write('App.dir', 'app');
|
Configure::write('App.dir', 'app');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue