setRequestMethod('GET'); $this->setHydrateClass(Model::class); $this->setRequestUri($uri); $api = $this->getApiInstance(); $api->show($uri); } public function testShowWrongUri() { $api = $this->getApiInstance(); $this->expectException(InvalidArgumentException::class); $api->show('https://api.mailgun.org/v2/domains/mydomain.com'); } public function testShowNonMailgunUri() { $api = $this->getApiInstance(); $this->expectException(InvalidArgumentException::class); $api->show('https://example.com/v2/domains/mailgun.net?x=attachments/0'); } }