Skip to content

Commit

Permalink
Add tests for deprecated method to not drop coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 17, 2017
1 parent 711c35f commit 90f00d7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/TestCase/ORM/AssociationTest.php
Expand Up @@ -533,6 +533,22 @@ public function testSetJoinType()
$this->assertEquals('LEFT', $this->association->getJoinType());
}

/**
* Tests dependent method
*
* @group deprecated
* @return void
*/
public function testDependent()
{
$this->deprecated(function () {
$this->assertTrue($this->association->dependent());
$this->association->dependent(false);
$this->assertFalse($this->association->dependent());
});
}


/**
* Tests property method
*
Expand Down Expand Up @@ -605,9 +621,28 @@ public function testPropertyNameExplicitySet()
/**
* Tests strategy method
*
* @group deprecated
* @return void
*/
public function testStrategy()
{
$this->deprecated(function () {
$this->assertEquals('join', $this->association->strategy());

$this->association->strategy('select');
$this->assertEquals('select', $this->association->strategy());

$this->association->strategy('subquery');
$this->assertEquals('subquery', $this->association->strategy());
});
}

/**
* Tests strategy method
*
* @return void
*/
public function testSetStrategy()
{
$this->assertEquals('join', $this->association->getStrategy());

Expand Down

0 comments on commit 90f00d7

Please sign in to comment.