Skip to content

Commit

Permalink
Merge pull request #32 from cakephp/master-tests
Browse files Browse the repository at this point in the history
Add tests for add and sub weekends during weekend
  • Loading branch information
markstory committed Oct 13, 2015
2 parents 1c875b4 + d8c49f5 commit dbf856b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/DateTime/AddTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ public function testAddDay($class)
$this->assertSame(1, $class::createFromDate(1975, 5, 31)->addDay()->day);
}

/**
* @dataProvider classNameProvider
* @return void
*/
public function testAddWeekdayDuringWeekend($class)
{
$this->assertSame(9, $class::createFromDate(2012, 1, 7)->addWeekday()->day);
}

/**
* @dataProvider classNameProvider
* @return void
Expand Down
9 changes: 9 additions & 0 deletions tests/DateTime/SubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ public function testSubDay($class)
$this->assertSame(30, $class::createFromDate(1975, 5, 1)->subDay()->day);
}

/**
* @dataProvider classNameProvider
* @return void
*/
public function testSubWeekdayDuringWeekend($class)
{
$this->assertSame(6, $class::createFromDate(2012, 1, 8)->subWeekday()->day);
}

/**
* @dataProvider classNameProvider
* @return void
Expand Down

0 comments on commit dbf856b

Please sign in to comment.