public function setBin($bin) { if (!is_numeric($bin) || strlen($bin) != 6) { throw new \UnexpectedValueException('O campo bin deve ser informado com os 6 primeiros dígitos do número do cartão'); } $this->bin = $bin; }
/** * @test */ public function setBinThrowsUnexpectedValue() { $this->setExpectedException(\UnexpectedValueException::class); $this->transaction->setBin(false); }