public function setUp() { $this->flashBag = m::mock('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface'); $this->session = m::mock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface'); $this->session->shouldReceive('getFlashBag')->withNoArgs()->atLeast()->once()->andReturn($this->flashBag); $this->flash = new FlashMessage($this->session); }