/**
  * 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);
 }
 /**
  * Test converting that quotation into an order
  * @depends testCheckOutAndroidAutoPay
  */
 public function testProcessAndroidQuoteAutoPay($orderId)
 {
     self::setFromEnv();
     SpringSignage\Api\Shop::processQuote($orderId, true);
 }