mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 17:12:49 +00:00
[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:
committed by
William Cheng
parent
ee5709177a
commit
4e5ec4c71c
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user