-
-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"copy-from-recipe": { | ||
"src/": "src/", | ||
"templates/": "templates/", | ||
"tests/": "tests/" | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
kbond/homepage-scaffold/0.1/src/Controller/HomepageController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class HomepageController extends AbstractController | ||
{ | ||
#[Route('/', name: 'homepage')] | ||
public function __invoke(): Response | ||
{ | ||
return $this->render('homepage.html.twig'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends 'base.html.twig' %} | ||
|
||
{% block title %}Home{% endblock %} | ||
|
||
{% block body %} | ||
<h1>Home</h1> | ||
|
||
{% for type, messages in app.flashes %} | ||
{% for message in messages %} | ||
<div class="alert alert-{{ type|replace({error: 'danger'}) }}"> | ||
{{ message }} | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
{% endblock %} |
19 changes: 19 additions & 0 deletions
19
kbond/homepage-scaffold/0.1/tests/Functional/HomepageTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Tests\Functional; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Zenstruck\Browser\Test\HasBrowser; | ||
|
||
class HomepageTest extends KernelTestCase | ||
{ | ||
use HasBrowser; | ||
|
||
public function testVisitHomepage(): void | ||
{ | ||
$this->browser() | ||
->visit('/') | ||
->assertSuccessful() | ||
; | ||
} | ||
} |