Skip to content

Commit

Permalink
Add plugin examples
Browse files Browse the repository at this point in the history
And correct typo
  • Loading branch information
AD7six committed Feb 16, 2015
1 parent 697d76a commit ae5e750
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/TestCase/ORM/TableRegistryTest.php
Expand Up @@ -192,9 +192,19 @@ public function testGetFallbacks()
$this->assertEquals('rebels', $result->table(), 'The table should be taken from options');
$this->assertEquals('C3P0', $result->alias());

$result = TableRegistry::get('Funky.Chipmunks');
$this->assertInstanceOf('Cake\ORM\Table', $result);
$this->assertEquals('chipmunks', $result->table(), 'The table should be derived from the alias');
$this->assertEquals('Chipmunks', $result->alias());

$result = TableRegistry::get('Awesome', ['className' => 'Funky.Monkies']);
$this->assertInstanceOf('Cake\ORM\Table', $result);
$this->assertEquals('monkies', $result->table(), 'The table should be derived from the classname');
$this->assertEquals('Awesome', $result->alias());

$result = TableRegistry::get('Stuff', ['className' => 'Cake\ORM\Table']);
$this->assertInstanceOf('Cake\ORM\Table', $result);
$this->assertEquals('stuff', $result->table(), 'The table should be drived from the alias');
$this->assertEquals('stuff', $result->table(), 'The table should be derived from the alias');
$this->assertEquals('Stuff', $result->alias());
}

Expand Down

0 comments on commit ae5e750

Please sign in to comment.