/** * @dataProvider genderInputsDataProvider * @param mixed $gender * @param bool $isValid */ public function testHasGenderThrowsExceptionWhenGenderInputIsInvalid($gender, $isValid) { $pesel = new Pesel("00010100008"); if ($isValid == false) { $this->setExpectedException('InvalidArgumentException', 'Podano płeć w niepoprawnym formacie'); } $pesel->hasGender($gender); }
/** * @dataProvider validNumberDataProvider * @param string $number * @param string $birthDate * @param int $gender */ public function testToStringReturnsCorrectNumber($number, $birthDate, $gender) { $pesel = Pesel::create($number); $actual = (string) $pesel; $this->assertEquals($number, $actual, "Invalid gender. Got {$actual}, expected {$number} for number {$number}"); }