Skip to content

Commit

Permalink
Add tests for templates load
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Aug 20, 2019
1 parent db3c24e commit b06eef4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Tests/Functional/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Hackzilla\Bundle\TicketBundle\Entity\TicketMessage;
use Hackzilla\Bundle\TicketBundle\Manager\TicketManagerInterface;
use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User;
use Twig\Template;
use Vich\UploaderBundle\Event\Events;

/**
Expand Down Expand Up @@ -56,4 +57,11 @@ public function testConfiguredFileUploadSubscriber()

$this->assertArrayHasKey(Events::POST_UPLOAD, $listeners);
}

public function testTemplateLoad()
{
$twig = static::$kernel->getContainer()->get('twig');

$this->assertInstanceOf(Template::class, $twig->loadTemplate('@HackzillaTicket/Ticket/index.html.twig'));
}
}
4 changes: 4 additions & 0 deletions Tests/Functional/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle;
use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User;
use Knp\Bundle\PaginatorBundle\KnpPaginatorBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
Expand Down Expand Up @@ -39,6 +41,8 @@ public function registerBundles()
new FrameworkBundle(),
new SecurityBundle(),
new DoctrineBundle(),
new KnpPaginatorBundle(),
new TwigBundle(),
new HackzillaTicketBundle(),
new TestBundle(),
];
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"php": "^5.6 || ^7.0",
"doctrine/doctrine-bundle": "^1.4",
"doctrine/orm": "^2.4.8",
"knplabs/knp-paginator-bundle": "^2.3 || ^3.0 || ^4.0",
"knplabs/knp-paginator-bundle": "^2.6 || ^3.0 || ^4.0",
"symfony/config": "^2.8 || ^3.0 || ^4.0",
"symfony/console": "^2.8 || ^3.0 || ^4.0",
"symfony/dependency-injection": "^2.8 || ^3.0 || ^4.0",
Expand Down

0 comments on commit b06eef4

Please sign in to comment.