initial commit
This commit is contained in:
16
vendor/symfony/maker-bundle/templates/test/ApiTestCase.tpl.php
vendored
Normal file
16
vendor/symfony/maker-bundle/templates/test/ApiTestCase.tpl.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
use <?= $api_test_case_fqcn; ?>;
|
||||
|
||||
class <?= $class_name ?> extends ApiTestCase
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
$response = static::createClient()->request('GET', '/');
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertJsonContains(['@id' => '/']);
|
||||
}
|
||||
}
|
||||
31
vendor/symfony/maker-bundle/templates/test/Functional.tpl.php
vendored
Normal file
31
vendor/symfony/maker-bundle/templates/test/Functional.tpl.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php /* @deprecated remove this method when removing make:unit-test and make:functional-test */ ?>
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
<?= $use_statements ?>
|
||||
|
||||
class <?= $class_name ?> extends <?= $panther_is_available ? 'PantherTestCase' : 'WebTestCase' ?><?= "\n" ?>
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
<?php if ($panther_is_available): ?>
|
||||
$client = static::createPantherClient();
|
||||
<?php else: ?>
|
||||
$client = static::createClient();
|
||||
<?php endif ?>
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
<?php if ($web_assertions_are_available): ?>
|
||||
<?php if (!$panther_is_available): ?>
|
||||
$this->assertResponseIsSuccessful();
|
||||
<?php endif ?>
|
||||
$this->assertSelectorTextContains('h1', 'Hello World');
|
||||
<?php else: ?>
|
||||
<?php if (!$panther_is_available): ?>
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
<?php endif ?>
|
||||
$this->assertStringContainsString('Hello World', $crawler->filter('h1')->text());
|
||||
<?php endif ?>
|
||||
}
|
||||
}
|
||||
17
vendor/symfony/maker-bundle/templates/test/KernelTestCase.tpl.php
vendored
Normal file
17
vendor/symfony/maker-bundle/templates/test/KernelTestCase.tpl.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
class <?= $class_name ?> extends KernelTestCase
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
|
||||
$this->assertSame('test', $kernel->getEnvironment());
|
||||
// $routerService = static::getContainer()->get('router');
|
||||
// $myCustomService = static::getContainer()->get(CustomService::class);
|
||||
}
|
||||
}
|
||||
20
vendor/symfony/maker-bundle/templates/test/PantherTestCase.tpl.php
vendored
Normal file
20
vendor/symfony/maker-bundle/templates/test/PantherTestCase.tpl.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
use Symfony\Component\Panther\PantherTestCase;
|
||||
|
||||
class <?= $class_name ?> extends PantherTestCase
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
$client = static::createPantherClient();
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
<?php if ($web_assertions_are_available): ?>
|
||||
$this->assertSelectorTextContains('h1', 'Hello World');
|
||||
<?php else: ?>
|
||||
$this->assertStringContainsString('Hello World', $crawler->filter('h1')->text());
|
||||
<?php endif ?>
|
||||
}
|
||||
}
|
||||
13
vendor/symfony/maker-bundle/templates/test/TestCase.tpl.php
vendored
Normal file
13
vendor/symfony/maker-bundle/templates/test/TestCase.tpl.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class <?= $class_name ?> extends TestCase
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
14
vendor/symfony/maker-bundle/templates/test/Unit.tpl.php
vendored
Normal file
14
vendor/symfony/maker-bundle/templates/test/Unit.tpl.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php /* @deprecated remove this method when removing make:unit-test and make:functional-test */ ?>
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
<?= $use_statements; ?>
|
||||
|
||||
class <?= $class_name ?> extends TestCase
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
22
vendor/symfony/maker-bundle/templates/test/WebTestCase.tpl.php
vendored
Normal file
22
vendor/symfony/maker-bundle/templates/test/WebTestCase.tpl.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $namespace; ?>;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class <?= $class_name ?> extends WebTestCase
|
||||
{
|
||||
public function testSomething(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
<?php if ($web_assertions_are_available): ?>
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertSelectorTextContains('h1', 'Hello World');
|
||||
<?php else: ?>
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$this->assertStringContainsString('Hello World', $crawler->filter('h1')->text());
|
||||
<?php endif ?>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user