Beispiel #1
0
 function __construct($name = null, array $data = [], $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $pass = (include __DIR__ . "/../config.php");
     $api = new \GoGetSSL\Api($pass['user'], $pass['pass']);
     $api->setLogPath(__DIR__ . "/../log/api.log")->enableLog();
     $this->tools = new \GoGetSSL\Tools($api);
     $api->onResponse(function ($response) use($api) {
         $api->log->info(json_encode($response, JSON_PRETTY_PRINT));
     });
 }
Beispiel #2
0
 public function testRequest()
 {
     $data = $this->credentials();
     $api = new \GoGetSSL\Api($data['user'], $data['pass']);
     $api->setLogPath(__DIR__ . "/../log/api.log")->enableLog();
     $productsApi = new \GoGetSSL\Product($api);
     $products = $productsApi->getAll();
     $details = $productsApi->getDetails(104);
     $price = $productsApi->getPrice(104);
     $this->assertTrue(is_object($products));
     $this->assertTrue($products->success);
     $this->assertTrue(is_object($details));
     $this->assertTrue(is_object($price));
 }