Skip to content

Commit

Permalink
Add dperecation warnings and fix tests in AssociationCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 16, 2017
1 parent df72de9 commit 6e9db33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ORM/AssociationCollection.php
Expand Up @@ -160,6 +160,10 @@ public function keys()
*/
public function type($class)
{
deprecationWarning(
'AssociationCollection::type() is deprecated. ' .
'Use getByType() instead.'
);
return $this->getByType($class);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/ORM/AssociationCollectionTest.php
Expand Up @@ -159,7 +159,7 @@ public function testGetByProperty()
$belongsTo = new BelongsTo('Users', [
'sourceTable' => $table
]);
$this->assertEquals('user', $belongsTo->property());
$this->assertEquals('user', $belongsTo->getProperty());
$this->associations->add('Users', $belongsTo);
$this->assertNull($this->associations->get('user'));

Expand Down

0 comments on commit 6e9db33

Please sign in to comment.