Skip to content

Commit

Permalink
Updated the assertion to an array comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
David Yell committed Apr 28, 2015
1 parent 6fb3b4d commit ac8ccae
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/TestCase/ORM/AssociationCollectionTest.php
Expand Up @@ -380,12 +380,8 @@ public function testAssociationsCanBeIterated()
$belongsToMany = new BelongsToMany('');
$this->associations->add('Cart', $belongsToMany);

foreach ($this->associations as $name => $association) {
if ($name === 'users') {
$this->assertInstanceOf('Cake\ORM\Association\BelongsTo', $association);
} else {
$this->assertInstanceOf('Cake\ORM\Association\BelongsToMany', $association);
}
}
$expected = ['users' => $belongsTo, 'cart' => $belongsToMany];
$result = iterator_to_array($this->associations, true);
$this->assertSame($expected, $result);
}
}

0 comments on commit ac8ccae

Please sign in to comment.