Skip to content

Commit 7e196f3

Browse files
committed
Add tests for templates load
1 parent db3c24e commit 7e196f3

4 files changed

Lines changed: 22 additions & 1 deletion

File tree

Tests/Functional/FunctionalTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Hackzilla\Bundle\TicketBundle\Entity\TicketMessage;
77
use Hackzilla\Bundle\TicketBundle\Manager\TicketManagerInterface;
88
use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User;
9+
use Twig\Template;
910
use Vich\UploaderBundle\Event\Events;
1011

1112
/**
@@ -56,4 +57,11 @@ public function testConfiguredFileUploadSubscriber()
5657

5758
$this->assertArrayHasKey(Events::POST_UPLOAD, $listeners);
5859
}
60+
61+
public function testTemplateLoad()
62+
{
63+
$twig = static::$kernel->getContainer()->get('twig');
64+
65+
$this->assertInstanceOf(Template::class, $twig->loadTemplate('@HackzillaTicket/Ticket/index.html.twig'));
66+
}
5967
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>{% block title %}HackzillaTicketBundle{% endblock %}</title>
5+
</head>
6+
<body>
7+
{% block body %}{% endblock %}
8+
</body>
9+
</html>

Tests/Functional/TestKernel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
66
use Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle;
77
use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User;
8+
use Knp\Bundle\PaginatorBundle\KnpPaginatorBundle;
89
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
910
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
1011
use Symfony\Bundle\SecurityBundle\SecurityBundle;
12+
use Symfony\Bundle\TwigBundle\TwigBundle;
1113
use Symfony\Component\Config\Loader\LoaderInterface;
1214
use Symfony\Component\DependencyInjection\ContainerBuilder;
1315
use Symfony\Component\HttpKernel\Kernel;
@@ -39,6 +41,8 @@ public function registerBundles()
3941
new FrameworkBundle(),
4042
new SecurityBundle(),
4143
new DoctrineBundle(),
44+
new KnpPaginatorBundle(),
45+
new TwigBundle(),
4246
new HackzillaTicketBundle(),
4347
new TestBundle(),
4448
];

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"php": "^5.6 || ^7.0",
2929
"doctrine/doctrine-bundle": "^1.4",
3030
"doctrine/orm": "^2.4.8",
31-
"knplabs/knp-paginator-bundle": "^2.3 || ^3.0 || ^4.0",
31+
"knplabs/knp-paginator-bundle": "^2.6 || ^3.0 || ^4.0",
3232
"symfony/config": "^2.8 || ^3.0 || ^4.0",
3333
"symfony/console": "^2.8 || ^3.0 || ^4.0",
3434
"symfony/dependency-injection": "^2.8 || ^3.0 || ^4.0",

0 commit comments

Comments
 (0)