public function testSetApiKey() { $gateway = \PagarMe\PagarMe::getInstance(); $gateway->setApiKey('s3cr3t'); $this->assertTrue($gateway->isValidKey()); $gateway->setApiKey(null); $this->assertFalse($gateway->isValidKey()); }
/** * @dataProvider apiKeysProvider * @expectedException \Exception */ public function testSetInvalidApiKey($apiKey) { $pagarme = new PagarMe(); $pagarme->setApiKey($apiKey); $this->assertFalse($pagarme->isApiKeyValid(), 'The API Key is valid.'); }