Browse Source

Add dperecation warnings and fix tests in AssociationCollection

Mark Story 8 years ago
parent
commit
6e9db33ddb

+ 4 - 0
src/ORM/AssociationCollection.php

@@ -160,6 +160,10 @@ class AssociationCollection implements IteratorAggregate
      */
     public function type($class)
     {
+        deprecationWarning(
+            'AssociationCollection::type() is deprecated. ' .
+            'Use getByType() instead.'
+        );
         return $this->getByType($class);
     }
 

+ 1 - 1
tests/TestCase/ORM/AssociationCollectionTest.php

@@ -159,7 +159,7 @@ class AssociationCollectionTest extends TestCase
         $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'));