diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 2d790942cb7..bc2fef9d619 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -284,7 +284,7 @@ public class DefaultCodegen { } /** - * Return the file name of the Api + * Return the file name of the Api Test * * @param name the file name of the Api * @return the file name of the Api @@ -314,7 +314,7 @@ public class DefaultCodegen { } /** - * Return the capitalized file name of the model + * Return the capitalized file name of the model test * * @param name the model name * @return the file name of the model @@ -2093,6 +2093,14 @@ public class DefaultCodegen { return apiFileFolder() + '/' + toApiFilename(tag) + suffix; } + /** + * Return the full path and API test file + * + * @param templateName template name + * @param tag tag + * + * @return the API test file name with full path + */ public String apiTestFilename(String templateName, String tag) { String suffix = apiTestTemplateFiles().get(templateName); return apiTestFileFolder() + '/' + toApiTestFilename(tag) + suffix; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 4a15853a412..263adc05cf8 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -311,6 +311,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { files.add(new File(filename)); } + // to generate api test files for (String templateName : config.apiTestTemplateFiles().keySet()) { String filename = config.apiTestFilename(templateName, tag); if (!config.shouldOverwrite(filename) && new File(filename).exists()) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php index 75928df30d3..3df47d97be1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php @@ -72,7 +72,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_updatePet() { - //$body = null } @@ -83,7 +82,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_addPet() { - //$body = null } @@ -94,7 +92,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_findPetsByStatus() { - //$status = null } @@ -105,7 +102,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_findPetsByTags() { - //$tags = null } @@ -116,7 +112,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_getPetById() { - //$pet_id } @@ -127,7 +122,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_updatePetWithForm() { - //$pet_id, $name = null, $status = null } @@ -138,7 +132,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_deletePet() { - //$pet_id, $api_key = null } @@ -149,7 +142,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_uploadFile() { - //$pet_id, $additional_metadata = null, $file = null } @@ -160,7 +152,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_getPetByIdWithByteArray() { - //$pet_id } @@ -171,7 +162,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase * */ public function test_addPetUsingByteArray() { - //$body = null } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php index 14cb5a68290..899f5791c8a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php @@ -72,7 +72,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase * */ public function test_getInventory() { - // } @@ -83,7 +82,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase * */ public function test_placeOrder() { - //$body = null } @@ -94,7 +92,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase * */ public function test_getOrderById() { - //$order_id } @@ -105,7 +102,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase * */ public function test_deleteOrder() { - //$order_id } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php index f69ccf8ef7b..500b99c4c4f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php @@ -72,7 +72,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_createUser() { - //$body = null } @@ -83,7 +82,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_createUsersWithArrayInput() { - //$body = null } @@ -94,7 +92,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_createUsersWithListInput() { - //$body = null } @@ -105,7 +102,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_loginUser() { - //$username = null, $password = null } @@ -116,7 +112,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_logoutUser() { - // } @@ -127,7 +122,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_getUserByName() { - //$username } @@ -138,7 +132,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_updateUser() { - //$username, $body = null } @@ -149,7 +142,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase * */ public function test_deleteUser() { - //$username }