Browse Source

Update tests to use new method.

ADmad 8 years ago
parent
commit
767526ce8f
1 changed files with 7 additions and 7 deletions
  1. 7 7
      tests/TestCase/ORM/AssociationCollectionTest.php

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

@@ -142,7 +142,7 @@ class AssociationCollectionTest extends TestCase
     }
 
     /**
-     *  Data provider for AssociationCollection::type
+     *  Data provider for AssociationCollection::getByType
      */
     public function associationCollectionType()
     {
@@ -154,13 +154,13 @@ class AssociationCollectionTest extends TestCase
     }
 
     /**
-     * Test getting association names by type.
+     * Test getting association names by getByType.
      *
      * @param string $belongsToStr
      * @param string $belongsToManyStr
      * @dataProvider associationCollectionType
      */
-    public function testType($belongsToStr, $belongsToManyStr)
+    public function testGetByType($belongsToStr, $belongsToManyStr)
     {
         $belongsTo = new BelongsTo('');
         $this->associations->add('Users', $belongsTo);
@@ -168,9 +168,9 @@ class AssociationCollectionTest extends TestCase
         $belongsToMany = new BelongsToMany('');
         $this->associations->add('Tags', $belongsToMany);
 
-        $this->assertSame([$belongsTo], $this->associations->type($belongsToStr));
-        $this->assertSame([$belongsToMany], $this->associations->type($belongsToManyStr));
-        $this->assertSame([$belongsTo, $belongsToMany], $this->associations->type([$belongsToStr, $belongsToManyStr]));
+        $this->assertSame([$belongsTo], $this->associations->getByType($belongsToStr));
+        $this->assertSame([$belongsToMany], $this->associations->getByType($belongsToManyStr));
+        $this->assertSame([$belongsTo, $belongsToMany], $this->associations->getByType([$belongsToStr, $belongsToManyStr]));
     }
 
     /**
@@ -181,7 +181,7 @@ class AssociationCollectionTest extends TestCase
     public function hasTypeReturnsEmptyArray()
     {
         foreach (['HasMany', 'hasMany', 'FooBar', 'DoesNotExist'] as $value) {
-            $this->assertSame([], $this->associations->type($value));
+            $this->assertSame([], $this->associations->getByType($value));
         }
     }