Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/Maker/TemplateLinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function getTestDetails(): \Generator
);

// Voter class name
$output = $runner->runMaker(['FooBar']);
$output = $runner->runMaker(['FooBar'], '-v');

$generatedTemplate = file_get_contents($runner->getPath('src/Security/Voter/FooBarVoter.php'));

Expand All @@ -73,7 +73,7 @@ public static function getTestDetails(): \Generator
);

// Voter class name
$output = $runner->runMaker(['FooBar']);
$output = $runner->runMaker(['FooBar'], '-v');

$generatedTemplate = file_get_contents($runner->getPath('src/Security/Voter/FooBarVoter.php'));

Expand All @@ -87,7 +87,7 @@ public static function getTestDetails(): \Generator
yield 'lints_templates_with_bundled_php_cs_fixer' => [self::buildMakerTest()
->run(static function (MakerTestRunner $runner) {
// Voter class name
$output = $runner->runMaker(['FooBar']);
$output = $runner->runMaker(['FooBar'], '-v');

$expectedOutput = 'Bundled PHP-CS-Fixer & Bundled PHP-CS-Fixer Configuration';
self::assertStringContainsString($expectedOutput, $output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Tests;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

final class GeneratedControllerTest extends WebTestCase
{
Expand All @@ -16,11 +18,16 @@ public function testControllerValidity()

public function testControllerInvokability()
{
$kernel = self::bootKernel();
$controller = $kernel->getContainer()->get('App\Controller\FooInvokableController');
self::bootKernel();
$container = static::getContainer();

$controller = $container->get('App\Controller\FooInvokableController');
$this->assertIsCallable($controller);

$request = Request::create('/foo/invokable');
$container->get('request_stack')->push($request);

$response = $controller();
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertInstanceOf(Response::class, $response);
}
}
Loading