[PHP] Cleanup StoreApiTest (#7248)

* Move test codes in "test" to "tests".

* Simplify class name specification

* Regenerate test/Api/StoreApiTest.php

testGetInventory already exists in tests/StoreApiTest.php
This commit is contained in:
Akihito Nakano
2018-01-07 12:46:31 +09:00
committed by William Cheng
parent ee5709177a
commit 4e5ec4c71c
2 changed files with 51 additions and 58 deletions

View File

@@ -2,7 +2,11 @@
namespace Swagger\Client;
use Swagger\Client\Api\PetApi;
use Swagger\Client\Api\StoreApi;
use Swagger\Client\Model\Category;
use Swagger\Client\Model\Pet;
use Swagger\Client\Model\Tag;
class StoreApiTest extends \PHPUnit_Framework_TestCase
{
@@ -11,7 +15,35 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
$this->api = new Api\StoreApi();
$this->api = new StoreApi();
}
/**
* Setup before running each test case
*/
public static function setUpBeforeClass()
{
// add a new pet (id 10005) to ensure the pet object is available for all the tests
// new pet
$id = 10005;
$pet = new Pet();
$pet->setId($id);
$pet->setName('PHP Unit Test');
$pet->setStatus('available');
// new tag
$tag = new Tag();
$tag->setId($id); // use the same id as pet
$tag->setName('test php tag');
// new category
$category = new Category();
$category->setId($id); // use the same id as pet
$category->setName('test php category');
$pet->setTags([$tag]);
$pet->setCategory($category);
$api = new PetApi();
$api->addPet($pet);
}
public function testGetInventory()