Today I encountered a problem with our phpunit tests for our symfony2 project. We were having issues with the ‘ErrorException: Notice: A session had already been started – ignoring session_start()’.
So after some googleing I found out that we shouldn’t create our own mock like we did here
$session = $this
But symfony now has their own mock to create a session.
$session = new Session(new MockArraySessionStorage());
Another problem solved in my day as a junior developer
All my tips have been moved to my blog www.pix-art.be so come check it out!