forked from wallabag/wallabag
symfony is there
This commit is contained in:
9
src/AppBundle/AppBundle.php
Normal file
9
src/AppBundle/AppBundle.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class AppBundle extends Bundle
|
||||
{
|
||||
}
|
||||
17
src/AppBundle/Controller/DefaultController.php
Normal file
17
src/AppBundle/Controller/DefaultController.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Controller;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
|
||||
class DefaultController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/app/example", name="homepage")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->render('default/index.html.twig');
|
||||
}
|
||||
}
|
||||
18
src/AppBundle/Tests/Controller/DefaultControllerTest.php
Normal file
18
src/AppBundle/Tests/Controller/DefaultControllerTest.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Tests\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class DefaultControllerTest extends WebTestCase
|
||||
{
|
||||
public function testIndex()
|
||||
{
|
||||
$client = static::createClient();
|
||||
|
||||
$crawler = $client->request('GET', '/app/example');
|
||||
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
$this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user