Skip to content

Commit e103470

Browse files
committed
fix unit tests
1 parent 2cd691a commit e103470

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tests/Handler/AlertifySessionHandlerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ public function testDefault()
2929
/** @var AlertifyHelper $helper */
3030
$helper = new AlertifyHelper($this->session);
3131
$handler = new AlertifySessionHandler(
32-
$this->getTwigEnvironmentMock(),
3332
$container->getParameter('troopers_alertify')
3433
);
34+
$twig = $this->getTwigEnvironmentMock();
3535

3636
$helper->congrat('Alert1');
37-
$this->assertEquals(1, count(explode(' ', $handler->handle($this->session))));
37+
$this->assertEquals(1, count(explode(' ', $handler->handle($this->session, $twig))));
3838
$helper->congrat('Alert2');
3939
$helper->congrat('Alert3', ['opt1' => 42]);
4040
$helper->congrat('Alert4');
41-
$this->assertEquals(3, count(explode(' ', $handler->handle($this->session))));
41+
$this->assertEquals(3, count(explode(' ', $handler->handle($this->session, $twig))));
4242
}
4343

4444
/**
@@ -52,6 +52,7 @@ protected function mockSession()
5252
protected function getTwigEnvironmentMock()
5353
{
5454
$twigEnvironment = $this->getMockBuilder('Twig_Environment')
55+
->disableOriginalConstructor()
5556
->setMethods(['render'])
5657
->getMock();
5758

0 commit comments

Comments
 (0)