/** * @param Event $event * * @throws PagSeguroException */ public function handleError(Event $event) { if (!Environment::isValid($event->getRequest()->getHost())) { return; } throw PagSeguroException::create($event->getResponse()); }
/** * @test */ public function isValidShouldReturnFalseWhenHostNotProductionOrSandbox() { $this->assertFalse(Environment::isValid('example.org')); }