Skip to content

Commit

Permalink
[PHP] Cleanup EnumTest (#7282)
Browse files Browse the repository at this point in the history
* Move test codes in "test" to "tests"

- EnumClassTest
- EnumTestTest

* Regenerate test/Model/Enum(Class|Test)Test.php
  • Loading branch information
ackintosh authored and wing328 committed Jan 7, 2018
1 parent 9b5bba0 commit 50d2178
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,74 @@
*
* @category Class
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/

/**
* Copyright 2016 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Swagger Petstore
*
* http://www.apache.org/licenses/LICENSE-2.0
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 2.3.0-SNAPSHOT
*/

/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Please update the test case below to test the model.
*/

namespace Swagger\Client\Model;
namespace Swagger\Client;

/**
* EnumClassTest Class Doc Comment
*
* @category Class
* @description EnumClass
* @category Class */
// * @description EnumClass
/**
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class EnumClassTest extends \PHPUnit_Framework_TestCase
{

/**
* Setup before running each test case
* Setup before running any test case
*/
public static function setUpBeforeClass()
{
}

/**
* Setup before running each test case
*/
public function setUp()
{
}

/**
* Clean up after running each test case
*/
public static function tearDownAfterClass()
public function tearDown()
{
}

/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
{
}

/**
* Test "EnumClass"
*/
public function testEnumClass()
{
$this->assertSame(EnumClass::ABC, "_abc");
$this->assertSame(EnumClass::EFG, "-efg");
$this->assertSame(EnumClass::XYZ, "(xyz)");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,72 +6,102 @@
*
* @category Class
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/

/**
* Copyright 2016 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Swagger Petstore
*
* http://www.apache.org/licenses/LICENSE-2.0
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 2.3.0-SNAPSHOT
*/

/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Please update the test case below to test the model.
*/

namespace Swagger\Client\Model;
namespace Swagger\Client;

/**
* EnumTestTest Class Doc Comment
*
* @category Class
* @description EnumTest
* @category Class */
// * @description EnumTest
/**
* @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class EnumTestTest extends \PHPUnit_Framework_TestCase
{

/**
* Setup before running each test case
* Setup before running any test case
*/
public static function setUpBeforeClass()
{
}

/**
* Setup before running each test case
*/
public function setUp()
{
}

/**
* Clean up after running each test case
*/
public static function tearDownAfterClass()
public function tearDown()
{
}

/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
{
}

/**
* Test "EnumTest"
*/
public function testEnumTest()
{
$this->assertSame(EnumTest::ENUM_STRING_UPPER, "UPPER");
$this->assertSame(EnumTest::ENUM_STRING_LOWER, "lower");
$this->assertSame(EnumTest::ENUM_INTEGER_1, 1);
$this->assertSame(EnumTest::ENUM_INTEGER_MINUS_1, -1);
$this->assertSame(EnumTest::ENUM_NUMBER_1_DOT_1, 1.1);
$this->assertSame(EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2);
}

/**
* Test attribute "enum_string"
*/
public function testPropertyEnumString()
{
}

/**
* Test attribute "enum_integer"
*/
public function testPropertyEnumInteger()
{
}

/**
* Test attribute "enum_number"
*/
public function testPropertyEnumNumber()
{
}

/**
* Test attribute "outer_enum"
*/
public function testPropertyOuterEnum()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Swagger\Client;

use Swagger\Client\Model\EnumClass;

class EnumClassTest extends \PHPUnit_Framework_TestCase
{
public function testPossibleValues()
{
$this->assertSame(EnumClass::ABC, '_abc');
$this->assertSame(EnumClass::EFG, '-efg');
$this->assertSame(EnumClass::XYZ, '(xyz)');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Swagger\Client;

use Swagger\Client\Model\EnumTest;

class EnumTestTest extends \PHPUnit_Framework_TestCase
{
public function testPossibleValues()
{
$this->assertSame(EnumTest::ENUM_STRING_UPPER, "UPPER");
$this->assertSame(EnumTest::ENUM_STRING_LOWER, "lower");
$this->assertSame(EnumTest::ENUM_INTEGER_1, 1);
$this->assertSame(EnumTest::ENUM_INTEGER_MINUS_1, -1);
$this->assertSame(EnumTest::ENUM_NUMBER_1_DOT_1, 1.1);
$this->assertSame(EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2);
}
}

0 comments on commit 50d2178

Please sign in to comment.