Skip to content

Commit

Permalink
Merge pull request #8 from ofcold/master
Browse files Browse the repository at this point in the history
K
  • Loading branch information
lilianjin authored May 27, 2018
2 parents 2581e1f + 5aa6202 commit 658c1cc
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions tests/IdentityCardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,50 @@

class IdentityCardTest extends PHPUnit\Framework\TestCase
{
public function testMakeIdentityCardInstance()
protected $idCard;

public function setUp()
{
$idCard = IdentityCard::make('142701198003124054');
$this->idCard = IdentityCard::make('142701198003124054');
}

$this->assertEquals(IdentityCard::class, get_class($idCard));
public function testMakeIdentityCardInstance()
{
$this->assertEquals(IdentityCard::class, get_class($this->idCard));
}

public function testMakeFalse()
{
$idCard = IdentityCard::make('');
$this->assertEquals(false, !is_a($this->idCard, IdentityCard::class));
}

$this->assertEquals(false, $idCard);
public function testArea()
{
$this->assertEquals('山西省 运城地区 运城市', $this->idCard->getArea());
}

public function testToJson()
public function testGender()
{
$this->assertEquals('', $this->idCard->getGender());
}

public function testBirthday()
{
$this->assertEquals('1980-03-12', $this->idCard->getBirthday());
}

public function testAge()
{
$this->assertEquals('38', $this->idCard->getAge());
}

public function testConstellation()
{
$idCard = IdentityCard::make('142701198003124054');
$this->assertEquals('双鱼座', $this->idCard->getConstellation());
}

$this->assertJson($idCard->toJson());
public function testToJson()
{
$this->assertJson($this->idCard->toJson());
}
}

0 comments on commit 658c1cc

Please sign in to comment.