コード例 #1
0
 /**
  * Test creating a CMS demo and then creating a quotation to convert it to a full account
  * @throws Exception
  */
 public function testCheckOutCmsDemoThenUpgrade()
 {
     self::setFromEnv();
     $cms = new \SpringSignage\Api\Product\CloudCms();
     $accountName = strtolower('api' . $this->generateRandomString(5));
     $cms->setNewInstance($accountName, 2, true, \SpringSignage\Api\Cloud::$LONDON);
     $order = \SpringSignage\Api\Shop::checkOut([$cms]);
     $this->assertNotEmpty($order);
     $this->assertArrayHasKey('orderId', (array) $order);
     // Process quote
     SpringSignage\Api\Shop::processQuote($order->orderId, false);
     // Demo's are automatically created, so we can get this demo now
     $instance = \SpringSignage\Api\Cloud::getInstances($accountName);
     $this->assertEquals($accountName, $instance->accountName);
     // Create another CMS product
     $cms = new \SpringSignage\Api\Product\CloudCms();
     $cms->setChangeExistingInstance($instance->hostingId, $instance->displays);
     $order = \SpringSignage\Api\Shop::checkOut([$cms]);
     $this->assertNotEmpty($order);
     $this->assertArrayHasKey('orderId', (array) $order);
 }
コード例 #2
0
 public function testInstanceList()
 {
     self::setFromEnv();
     $instances = \SpringSignage\Api\Cloud::getInstances();
     $this->assertArrayHasKey('data', (array) $instances);
 }