Skip to content
Permalink
Browse files

Add tests for new className() method on Association.

  • Loading branch information...
adamroyle committed Feb 24, 2016
1 parent dae91d0 commit f804099f58f9f8d417c30b3d4fdc9dff3a090b88
Showing with 32 additions and 0 deletions.
  1. +32 −0 tests/TestCase/ORM/AssociationTest.php
@@ -108,6 +108,38 @@ public function testName()
$this->assertEquals('Bar', $this->association->name());
}
/**
* Tests that className() returns the correct association className
*
* @return void
*/
public function testClassName()
{
$this->assertEquals('\Cake\Test\TestCase\ORM\TestTable', $this->association->className());
}
/**
* Tests that className() returns the correct (unnormalized) className
*
* @return void
*/
public function testClassNameUnnormalized()
{
$config = [
'className' => 'Test',
];
$this->association = $this->getMock(
'\Cake\ORM\Association',
[
'_options', 'attachTo', '_joinCondition', 'cascadeDelete', 'isOwningSide',
'saveAssociated', 'eagerLoader', 'type'
],
['Foo', $config]
);
$this->assertEquals('Test', $this->association->className());
}
/**
* Tests that cascadeCallbacks() returns the correct configured value
*

0 comments on commit f804099

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