1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Added automated tests for API

This commit is contained in:
Hillel Coren 2016-05-02 22:51:22 +03:00
parent 29a03179a9
commit f74b30cdde
2 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<?php //[STAMP] 33bf8261bed0f36cf769e15182e6d905 <?php //[STAMP] a3cf36879dbbec28f15389e7d8d325a2
namespace _generated; namespace _generated;
// This class was automatically generated by build task // This class was automatically generated by build task

View File

@ -70,6 +70,18 @@ class APICest
$this->createEntity('tax_rate', $data); $this->createEntity('tax_rate', $data);
$this->listEntities('tax_rate'); $this->listEntities('tax_rate');
$data = new stdClass;
$data->product_key = $this->faker->word;
$data->notes = $this->faker->realText(100);
$this->createEntity('product', $data);
$this->listEntities('product');
$data = new stdClass;
$data->name = $this->faker->word;
$data->vendorcontacts = [];
$this->createEntity('vendor', $data);
$this->listEntities('vendor');
$this->listEntities('account'); $this->listEntities('account');
} }
@ -79,6 +91,7 @@ class APICest
$response = $this->sendRequest("{$entityType}s", $data); $response = $this->sendRequest("{$entityType}s", $data);
$entityId = $response->data->id; $entityId = $response->data->id;
PHPUnit_Framework_Assert::assertGreaterThan(0, $entityId); PHPUnit_Framework_Assert::assertGreaterThan(0, $entityId);
return $entityId; return $entityId;