All Downloads are FREE. Search and download functionalities are using the official Maven repository.

php-symfony.testing.model_test.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
partial_header}}
/**
 * NOTE: This class is auto generated by the openapi generator program.
 * https://github.com/openapitools/openapi-generator
 * Please update the test case below to test the model.
 */

namespace {{modelTestsPackage}};

use {{modelPackage}}\{{classname}};
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

/**
 * {{classname}}Test Class Doc Comment
 *
 * @category    Class
 * @description {{description}}{{^description}}{{classname}}{{/description}}
 * @package     {{modelTestsPackage}}
 * @author      openapi-generator contributors
 * @link        https://github.com/openapitools/openapi-generator
 * @coversDefaultClass \{{modelPackage}}\{{classname}}
 */
class {{classname}}Test extends TestCase
{
    protected {{classname}}|MockObject $object;

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

    /**
     * Setup before running each test case
     */
    public function setUp(): void
    {
        {{^isEnum}}
        $this->object = $this->getMockBuilder({{classname}}::class)->getMockForAbstractClass();
        {{/isEnum}}
    }

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

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

    /**
     * @group integration
     * @small
     */
    public function testTestClassExists(): void
    {
        {{#isEnum}}
        $this->assertTrue(enum_exists({{classname}}::class));
        {{/isEnum}}
        {{^isEnum}}
        $this->assertTrue(class_exists({{classname}}::class));
        $this->assertInstanceOf({{classname}}::class, $this->object);
        {{/isEnum}}
    }
{{#vars}}

    /**
     * Test attribute "{{name}}"
     *
     * @group unit
     * @small
     */
    public function testProperty{{nameInCamelCase}}(): void
    {
        $this->markTestSkipped('Test for property {{name}} not implemented');
    }
{{/vars}}
}
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy