Skip to content
Permalink
Browse files

Invalid table assertion.

  • Loading branch information...
robertpustulka committed Feb 2, 2017
1 parent 603a32e commit 45cc8da998f9a7361952d3f917ff05e32e0ba131
Showing with 25 additions and 0 deletions.
  1. +25 −0 tests/TestCase/ORM/AssociationTest.php
@@ -141,6 +141,31 @@ public function testClassNameUnnormalized()
$this->assertEquals('Test', $this->association->className());
}
/**
* Tests that an exception is thrown when invalid target table is fetched
* from a registry.
*
* @return void
* @expectedException \RuntimeException
*/
public function testInvalidTableFetchedFromRegistry()
{
TableRegistry::get('Test');
$config = [
'className' => '\Cake\Test\TestCase\ORM\TestTable',
];
$this->association = $this->getMockBuilder('\Cake\ORM\Association')
->setMethods([
'_options', 'attachTo', '_joinCondition', 'cascadeDelete', 'isOwningSide',
'saveAssociated', 'eagerLoader', 'type', 'requiresKeys'
])
->setConstructorArgs(['Test', $config])
->getMock();
$this->association->getTarget();
}
/**
* Tests that cascadeCallbacks() returns the correct configured value
*

0 comments on commit 45cc8da

Please sign in to comment.
You can’t perform that action at this time.