Skip to content

Commit

Permalink
Add test to increase coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 17, 2017
1 parent 90f00d7 commit 5428f60
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/TestCase/ORM/Association/HasManyTest.php
Expand Up @@ -923,4 +923,18 @@ public function testSaveAssociatedEmptySetWithReplaceStrategyRemovesAssociatedRe
]);
$this->assertEmpty($entity->get('comments'));
}

/**
* Tests that providing an invalid strategy throws an exception
*
* @return void
*/
public function testInvalidStrategy()
{
$this->expectException(\InvalidArgumentException::class);
$articles = TableRegistry::get('Articles');

$association = $articles->hasMany('Comments');
$association->setStrategy('anotherThing');
}
}

0 comments on commit 5428f60

Please sign in to comment.