Skip to content

Commit

Permalink
More explicit assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 7, 2013
1 parent 5b411bf commit 2f0c4b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cake/Test/TestCase/ORM/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,11 +814,13 @@ class_alias($departmentEntity, 'Foo\Model\Entity\Department');

$table->entityClass($entity);
$association = $table->association('Bar');
$this->assertInstanceOf('\Cake\ORM\Association\BelongsTo', $association);
$this->assertEquals('Bar', $association->name());
$this->assertEquals('bar', $association->property());
$this->assertSame($barTarget, $association->target());

$association = $table->association('Department');
$this->assertInstanceOf('\Cake\ORM\Association\BelongsTo', $association);
$this->assertEquals('Department', $association->name());
$this->assertEquals('department', $association->property());
$this->assertSame($depatmentTarget, $association->target());
Expand Down Expand Up @@ -858,11 +860,13 @@ class_alias($bazEntity, 'Foo\Model\Entity\Baz');

$table->entityClass($entity);
$association = $table->association('Bar');
$this->assertInstanceOf('\Cake\ORM\Association\BelongsTo', $association);
$this->assertEquals('Bar', $association->name());
$this->assertEquals('thing', $association->property());
$this->assertSame($barTarget, $association->target());

$association = $table->association('Baz');
$this->assertInstanceOf('\Cake\ORM\Association\BelongsTo', $association);
$this->assertEquals('Baz', $association->name());
$this->assertEquals('baz', $association->property());
$this->assertEquals('crazy_id', $association->foreignKey());
Expand Down Expand Up @@ -907,11 +911,13 @@ class_alias($bazEntity, 'Foo2\Model\Entity\Baz');

$table->entityClass($entity);
$association = $table->association('Bar');
$this->assertInstanceOf('\Cake\ORM\Association\HasMany', $association);
$this->assertEquals('Bar', $association->name());
$this->assertEquals('bars', $association->property());
$this->assertSame($barTarget, $association->target());

$association = $table->association('Baz');
$this->assertInstanceOf('\Cake\ORM\Association\HasOne', $association);
$this->assertEquals('Baz', $association->name());
$this->assertEquals('baz', $association->property());
$this->assertSame($bazTarget, $association->target());
Expand Down

0 comments on commit 2f0c4b5

Please sign in to comment.