Skip to content

Commit

Permalink
Adds some @Covers annotations
Browse files Browse the repository at this point in the history
To make PHPUnit happy ;)
  • Loading branch information
heiglandreas committed Mar 10, 2017
1 parent 9764f8f commit 4b90aed
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 6 deletions.
47 changes: 46 additions & 1 deletion tests/HolidaycheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,27 @@

class HolidaycheckerTest extends TestCase
{
/** @dataProvider integrationProvider */
/**
* @dataProvider integrationProvider
* @covers \Org_Heigl\Holidaychecker\HolidayIteratorFactory::createIteratorFromXmlFile
* @covers \Org_Heigl\Holidaychecker\Holidaychecker::__construct
* @covers \Org_Heigl\Holidaychecker\Holidaychecker::check
* @covers \Org_Heigl\Holidaychecker\Holiday::isHoliday
* @covers \Org_Heigl\Holidaychecker\Holiday::isNamed
* @covers \Org_Heigl\Holidaychecker\Holiday::getName
* @covers \Org_Heigl\Holidaychecker\Holiday::__construct
* @covers \Org_Heigl\Holidaychecker\HolidayIterator::append
* @covers \Org_Heigl\Holidaychecker\HolidayIteratorFactory::getElement
* @covers \Org_Heigl\Holidaychecker\HolidayIteratorFactory::getFree
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::dateMatches
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::dateMatches
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::getEaster
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::__construct
*/
public function testIntegration($date, $holiday, $named, $name)
{
$factory = new HolidayIteratorFactory();
Expand All @@ -56,6 +76,31 @@ public function integrationProvider()
];
}

/**
* @covers \Org_Heigl\Holidaychecker\HolidayIteratorFactory::createIteratorFromXmlFile
* @covers \Org_Heigl\Holidaychecker\Holidaychecker::__construct
* @covers \Org_Heigl\Holidaychecker\Holidaychecker::check
* @covers \Org_Heigl\Holidaychecker\Holiday::isHoliday
* @covers \Org_Heigl\Holidaychecker\Holiday::isNamed
* @covers \Org_Heigl\Holidaychecker\Holiday::getName
* @covers \Org_Heigl\Holidaychecker\Holiday::__construct
* @covers \Org_Heigl\Holidaychecker\HolidayIterator::append
* @covers \Org_Heigl\Holidaychecker\HolidayIteratorFactory::getElement
* @covers \Org_Heigl\Holidaychecker\HolidayIteratorFactory::getFree
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::dateMatches
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::dateMatches
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::getEaster
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::dateMatches
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::isHoliday
*/
public function testSpeed()
{
$factory = new HolidayIteratorFactory();
Expand Down
8 changes: 7 additions & 1 deletion tests/IteratorItem/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@

class DateTest extends TestCase
{
/** @dataProvider dateProvider */
/**
* @dataProvider dateProvider
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Date::dateMatches
*/
public function testThatDateTestWorks($dateTime, $day, $month, $year, $result, $name, $isHoliday)
{
$easter = new Date($name, $isHoliday, $day, $month, $year);
Expand Down
8 changes: 7 additions & 1 deletion tests/IteratorItem/EasterOrthodoxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@

class EasterOrthodoxTest extends TestCase
{
/** @dataProvider easterProvider */
/**
* @dataProvider easterProvider
* @covers \Org_Heigl\Holidaychecker\IteratorItem\EasterOrthodox::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\EasterOrthodox::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\EasterOrthodox::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\EasterOrthodox::dateMatches
*/
public function testThatEasterIsIdentifiedCorrectly($dateTime, $offset, $result, $name, $isHoliday)
{
$this->markTestSkipped('Not yet to be done');
Expand Down
9 changes: 8 additions & 1 deletion tests/IteratorItem/EasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@

class EasterTest extends TestCase
{
/** @dataProvider easterProvider */
/**
* @dataProvider easterProvider
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::dateMatches
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Easter::getEaster
*/
public function testThatEasterIsIdentifiedCorrectly($dateTime, $offset, $result, $name, $isHoliday)
{
$easter = new Easter($name, $isHoliday, $offset);
Expand Down
9 changes: 7 additions & 2 deletions tests/IteratorItem/RelativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@

namespace Org_Heigl\HolidaycheckerTest\IteratorItem;

use Org_Heigl\Holidaychecker\IteratorItem\Easter;
use Org_Heigl\Holidaychecker\IteratorItem\Relative;
use PHPUnit\Framework\TestCase;

class RelativeTest extends TestCase
{
/** @dataProvider dateProvider */
/**
* @dataProvider dateProvider
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::getName
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::isHoliday
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::__construct
* @covers \Org_Heigl\Holidaychecker\IteratorItem\Relative::dateMatches
*/
public function testThatDateTestWorks($dateTime, $day, $month, $relation, $result, $name, $isHoliday)
{
$easter = new Relative($name, $isHoliday, $day, $month, $relation);
Expand Down

0 comments on commit 4b90aed

Please sign in to comment.