Skip to content

Commit

Permalink
Add test for TableRegistry::set with plugin syntax aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Berry Goudswaard committed Nov 20, 2014
1 parent dc0db6a commit fc84ac1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TestCase/ORM/TableRegistryTest.php
Expand Up @@ -318,6 +318,21 @@ public function testSet() {
$this->assertSame($mock, TableRegistry::get('Articles'));
}

/**
* Test setting an instance with plugin syntax aliases
*
* @return void
*/
public function testSetPlugin() {
Plugin::load('TestPlugin');

$mock = $this->getMock('TestPlugin\Model\Table\CommentsTable');

$this->assertSame($mock, TableRegistry::set('TestPlugin.Comments', $mock));
$this->assertSame($mock, TableRegistry::get('TestPlugin.Comments'));
$this->assertSame($mock, TableRegistry::get('Comments'));
}

/**
* Tests genericInstances
*
Expand Down

0 comments on commit fc84ac1

Please sign in to comment.