Skip to content

Commit

Permalink
Extend Parser coverage, add coversDefaultClass annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Horat1us committed Jun 5, 2018
1 parent b3f3fef commit ad4fe94
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Class ParserTest
* @package Horat1us\Inn\Tests
* @coversDefaultClass \Horat1us\Inn\Parser
*/
class ParserTest extends TestCase
{
Expand All @@ -34,4 +35,22 @@ public function testBirthDate(): void
{
$this->assertEquals(new \DateTime('03/12/1987'), $this->parser->birthDate());
}

public function testParse(): void
{
$info = $this->parser->parse();

$this->assertTrue($info->isValid());
$this->assertEquals(Inn\Gender::MALE, $info->getGender());
$this->assertEquals(new \DateTime('03/12/1987'), $info->getBirthDate());
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Inn must contain 10 digits
*/
public function testInvalidInn(): void
{
new Inn\Parser("invalidInn");
}
}

0 comments on commit ad4fe94

Please sign in to comment.