Skip to content

Commit

Permalink
Strict typing sure would be nice
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Feb 14, 2015
1 parent c10e029 commit 1eca423
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/TestCase/ORM/AssociationCollectionTest.php
Expand Up @@ -50,7 +50,7 @@ public function testAddHasRemoveAndGet()
$this->assertNull($this->associations->get('users'));
$this->assertNull($this->associations->get('Users'));

$belongsTo = new BelongsTo([]);
$belongsTo = new BelongsTo('');
$this->assertSame($belongsTo, $this->associations->add('Users', $belongsTo));
$this->assertTrue($this->associations->has('users'));
$this->assertTrue($this->associations->has('Users'));
Expand All @@ -75,9 +75,9 @@ public function testRemoveAll()
{
$this->assertEmpty($this->associations->keys());

$belongsTo = new BelongsTo([]);
$belongsTo = new BelongsTo('');
$this->assertSame($belongsTo, $this->associations->add('Users', $belongsTo));
$belongsToMany = new BelongsToMany([]);
$belongsToMany = new BelongsToMany('');
$this->assertSame($belongsToMany, $this->associations->add('Cart', $belongsToMany));

$this->associations->removeAll();
Expand Down Expand Up @@ -109,7 +109,7 @@ public function testAddHasRemoveGetWithPlugin()
$this->assertFalse($this->associations->has('Photos.Photos'));
$this->assertFalse($this->associations->has('Photos'));

$belongsTo = new BelongsTo([]);
$belongsTo = new BelongsTo('');
$this->assertSame($belongsTo, $this->associations->add('Photos.Photos', $belongsTo));
$this->assertTrue($this->associations->has('Photos'));
$this->assertFalse($this->associations->has('Photos.Photos'));
Expand All @@ -122,7 +122,7 @@ public function testAddHasRemoveGetWithPlugin()
*/
public function testKeys()
{
$belongsTo = new BelongsTo([]);
$belongsTo = new BelongsTo('');
$this->associations->add('Users', $belongsTo);
$this->associations->add('Categories', $belongsTo);
$this->assertEquals(['users', 'categories'], $this->associations->keys());
Expand All @@ -138,10 +138,10 @@ public function testKeys()
*/
public function testType()
{
$belongsTo = new BelongsTo([]);
$belongsTo = new BelongsTo('');
$this->associations->add('Users', $belongsTo);

$belongsToMany = new BelongsToMany([]);
$belongsToMany = new BelongsToMany('');
$this->associations->add('Tags', $belongsToMany);

$this->assertSame([$belongsTo], $this->associations->type('BelongsTo'));
Expand All @@ -156,8 +156,8 @@ public function testType()
*/
public function testCascadeDelete()
{
$mockOne = $this->getMock('Cake\ORM\Association\BelongsTo', [], [[]]);
$mockTwo = $this->getMock('Cake\ORM\Association\HasMany', [], [[]]);
$mockOne = $this->getMock('Cake\ORM\Association\BelongsTo', [], ['']);
$mockTwo = $this->getMock('Cake\ORM\Association\HasMany', [], ['']);

$entity = new Entity();
$options = ['option' => 'value'];
Expand Down Expand Up @@ -361,7 +361,7 @@ public function testNormalizeKeys()
$expected = ['a' => [], 'b' => [], 'd' => ['something']];
$this->assertSame($expected, $this->associations->normalizeKeys($assocs));

$belongsTo = new BelongsTo([]);
$belongsTo = new BelongsTo('');
$this->associations->add('users', $belongsTo);
$this->associations->add('categories', $belongsTo);
$expected = ['users' => [], 'categories' => []];
Expand Down

0 comments on commit 1eca423

Please sign in to comment.