Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulandrieux committed Jun 23, 2017
1 parent 2cd691a commit e103470
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Tests/Handler/AlertifySessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ public function testDefault()
/** @var AlertifyHelper $helper */
$helper = new AlertifyHelper($this->session);
$handler = new AlertifySessionHandler(
$this->getTwigEnvironmentMock(),
$container->getParameter('troopers_alertify')
);
$twig = $this->getTwigEnvironmentMock();

$helper->congrat('Alert1');
$this->assertEquals(1, count(explode(' ', $handler->handle($this->session))));
$this->assertEquals(1, count(explode(' ', $handler->handle($this->session, $twig))));
$helper->congrat('Alert2');
$helper->congrat('Alert3', ['opt1' => 42]);
$helper->congrat('Alert4');
$this->assertEquals(3, count(explode(' ', $handler->handle($this->session))));
$this->assertEquals(3, count(explode(' ', $handler->handle($this->session, $twig))));
}

/**
Expand All @@ -52,6 +52,7 @@ protected function mockSession()
protected function getTwigEnvironmentMock()
{
$twigEnvironment = $this->getMockBuilder('Twig_Environment')
->disableOriginalConstructor()
->setMethods(['render'])
->getMock();

Expand Down

0 comments on commit e103470

Please sign in to comment.