Permalink
Browse files

Fixing CakeSchema to test APP_DIR with different names than all lower…

…case
  • Loading branch information...
Jelle Henkens
Jelle Henkens committed May 15, 2012
1 parent 6bb29ea commit 110536d5757545faa3118e24b8b40ceda29d59eb
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/Cake/Test/Case/Model/CakeSchemaTest.php
@@ -510,12 +510,24 @@ public function tearDown() {
*/
public function testSchemaName() {
$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');
$Schema = new CakeSchema();
$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');
}

0 comments on commit 110536d

Please sign in to comment.