示例#1
0
 public static function getClient()
 {
     if (!self::$client) {
         self::$client = new Client(KBGDC_API_URL, self::getLogger(), null, ['verify' => false]);
         self::$client->setLogData(['app' => KBGDC_APP_NAME]);
     }
     self::$client->login(KBGDC_USERNAME, KBGDC_PASSWORD);
     return self::$client;
 }
 public function testGoodDataClientJsonLoginBadPassword()
 {
     $client = new Client(KBGDC_API_URL);
     try {
         $client->login(KBGDC_USERNAME, uniqid());
         $this->fail();
     } catch (Exception $e) {
         $this->assertEquals(403, $e->getCode());
     }
 }