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