Skip to content

Commit

Permalink
Fix test failures.
Browse files Browse the repository at this point in the history
There is a strange error coming out of PHPUnit related to the `@depends`
annotation. Since we don't _need_ to use it we can unroll the dependent
tests.
  • Loading branch information
markstory committed Nov 15, 2016
1 parent 42f6846 commit d1f0449
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions tests/TestCase/ORM/Behavior/TimestampBehaviorTest.php
Expand Up @@ -221,9 +221,9 @@ public function testInvalidEventConfig()
public function testGetTimestamp()
{
$table = $this->getMockBuilder('Cake\ORM\Table')->getMock();
$this->Behavior = new TimestampBehavior($table);
$behavior = new TimestampBehavior($table);

$return = $this->Behavior->timestamp();
$return = $behavior->timestamp();
$this->assertInstanceOf(
'DateTime',
$return,
Expand All @@ -232,22 +232,20 @@ public function testGetTimestamp()

$now = Time::now();
$this->assertEquals($now, $return);

return $this->Behavior;
}

/**
* testGetTimestampPersists
*
* @depends testGetTimestamp
* @return void
*/
public function testGetTimestampPersists($behavior)
public function testGetTimestampPersists()
{
$this->Behavior = $behavior;
$table = $this->getMockBuilder('Cake\ORM\Table')->getMock();
$behavior = new TimestampBehavior($table);

$initialValue = $this->Behavior->timestamp();
$postValue = $this->Behavior->timestamp();
$initialValue = $behavior->timestamp();
$postValue = $behavior->timestamp();

$this->assertSame(
$initialValue,
Expand All @@ -259,15 +257,15 @@ public function testGetTimestampPersists($behavior)
/**
* testGetTimestampRefreshes
*
* @depends testGetTimestamp
* @return void
*/
public function testGetTimestampRefreshes($behavior)
public function testGetTimestampRefreshes()
{
$this->Behavior = $behavior;
$table = $this->getMockBuilder('Cake\ORM\Table')->getMock();
$behavior = new TimestampBehavior($table);

$initialValue = $this->Behavior->timestamp();
$postValue = $this->Behavior->timestamp(null, true);
$initialValue = $behavior->timestamp();
$postValue = $behavior->timestamp(null, true);

$this->assertNotSame(
$initialValue,
Expand Down

0 comments on commit d1f0449

Please sign in to comment.