mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-09 13:36:07 +09:00
79 lines
1.9 KiB
PHP
79 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* @group Core
|
|
*/
|
|
class Api_Client_OrderTest extends BBDbApiTestCase
|
|
{
|
|
protected $_initialSeedFile = 'orders.xml';
|
|
|
|
public function testOrders()
|
|
{
|
|
$data = array(
|
|
'page' => 1,
|
|
'per_page' => 10,
|
|
);
|
|
$array = $this->api_client->order_get_list($data);
|
|
$this->assertInternalType('array', $array);
|
|
|
|
$data = array(
|
|
'page' => 1,
|
|
'per_page' => 10,
|
|
'expiring' => 1,
|
|
);
|
|
$array = $this->api_client->order_get_list($data);
|
|
$this->assertInternalType('array', $array);
|
|
|
|
$data = array(
|
|
'id' => 1,
|
|
);
|
|
$array = $this->api_client->order_get($data);
|
|
$this->assertInternalType('array', $array);
|
|
|
|
$array = $this->api_client->order_addons($data);
|
|
$this->assertInternalType('array', $array);
|
|
}
|
|
|
|
public function testDelete()
|
|
{
|
|
$data = array(
|
|
'id' => 9,
|
|
);
|
|
|
|
$bool = $this->api_client->order_delete($data);
|
|
$this->assertTrue($bool);
|
|
}
|
|
|
|
public function testService()
|
|
{
|
|
$data = array(
|
|
'id' => 8,
|
|
);
|
|
|
|
$expected = array(
|
|
'id' => 1,
|
|
'client_id' => 1,
|
|
'plugin' => 'Example',
|
|
'updated_at' => null,
|
|
'created_at' => null,
|
|
);
|
|
|
|
|
|
$result = $this->api_client->order_service($data);
|
|
$this->assertInternalType('array', $result);
|
|
$this->assertNotEmpty($result);
|
|
|
|
$this->assertEquals($expected, $result);
|
|
}
|
|
|
|
public function testupgradables_NoUpgradablesFound()
|
|
{
|
|
$data = array(
|
|
'id' => 8,
|
|
);
|
|
|
|
$result = $this->api_client->order_upgradables($data);
|
|
$this->assertInternalType('array', $result);
|
|
$this->assertEmpty($result);
|
|
}
|
|
}
|