Skip to content

Commit

Permalink
Add tests for new className() method on Association.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamroyle committed Feb 24, 2016
1 parent dae91d0 commit f804099
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/TestCase/ORM/AssociationTest.php
Expand Up @@ -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
*
Expand Down

0 comments on commit f804099

Please sign in to comment.