Fixing CakeSchema to test APP_DIR with different names than all lowercase

This commit is contained in:
Jelle Henkens 2012-05-15 21:41:11 +01:00
parent 6bb29ea03b
commit 110536d575

View file

@ -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');
} }