/** * Test creating an android quotation * @return int * @throws Exception */ public function testCheckOutAndroidAutoPay() { self::setFromEnv(); $android = new \SpringSignage\Api\Product\Android(); $android->emailAddress = '*****@*****.**'; $android->version = '1.7'; $android->numLicences = 2; $order = \SpringSignage\Api\Shop::checkOut([$android]); $this->assertNotEmpty($order); $this->assertArrayHasKey('orderId', (array) $order); return $order->orderId; }
/** * 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); }