/** * @see PaymentApi::ping() */ public function testPingWrongCredentials() { try { $this->credentials->setApiLogin('wrong-login')->setApiKey('wrong-key'); $rs = $this->object->ping(); } catch (\Exception $e) { $this->assertInstanceOf('\\PayU\\PayUException', $e); $this->assertEquals('Invalid credentials', $e->getMessage()); $this->assertEquals(0, $e->getCode()); } }
/** * @see MerchantCredentials::setApiLogin() */ public function testSetApiLoginNewInstance() { $this->object = new MerchantCredentials(); $apiLogin = '******' . rand(1, 1000); $rs = $this->object->setApiLogin($apiLogin); $this->assertInstanceOf('\\PayU\\Merchant\\MerchantCredentials', $rs); $rs = $this->object->getApiLogin(); $this->assertInternalType('string', $rs); $this->assertEquals($apiLogin, $rs); }