faker = new Generator(); $this->faker->addProvider(new Person($this->faker)); } public function testIndividualIdentificationNumberIsValid() { $birthDate = DateTime::dateTimeBetween('-30 years', '-10 years'); $individualIdentificationNumber = $this->faker->individualIdentificationNumber($birthDate); $controlDigit = Person::checkSum($individualIdentificationNumber); $this->assertTrue($controlDigit === (int)substr($individualIdentificationNumber, 11, 1)); } }