Fix tests

This commit is contained in:
Nicolas Le Goff
2014-05-23 10:44:03 +02:00
parent 2cd0f1879d
commit e15a2ffd92
4 changed files with 10 additions and 5 deletions

View File

@@ -75,6 +75,7 @@ class SessionManagerSubscriber implements EventSubscriberInterface
return;
}
$moduleName = strtolower($pathInfo[1]);
if (!array_key_exists($moduleName, $modulesIds) ) {
return;
}
@@ -90,6 +91,11 @@ class SessionManagerSubscriber implements EventSubscriberInterface
if ($this->isFlashUploadRequest($event->getRequest())) {
return;
}
if ($event->getRequest()->query->has('LOG')) {
return;
}
// if we are already disconnected (ex. from another window), quit immediatly
if (!($this->app['authentication']->isAuthenticated())) {
if ($event->getRequest()->isXmlHttpRequest()) {

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Application;
class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
class LightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
protected $client;

View File

@@ -74,9 +74,9 @@ class SessionManagerSubscriberTest extends \PhraseanetWebTestCaseAuthenticatedAb
$session->setUpdated(new \DateTime());
$app['EM'] = $this->getMockBuilder('Doctrine\ORM\EntityManager')->disableOriginalConstructor()->getMock();
$app['EM']->expects($this->once())->method('find')->with($this->equalTo('Entities\Session'))->will($this->returnValue($session));
$app['EM']->expects($this->exactly(2))->method('persist')->will($this->returnValue(null));
$app['EM']->expects($this->once())->method('flush')->will($this->returnValue(null));
$app['EM']->expects($this->exactly(2))->method('find')->with($this->equalTo('Entities\Session'))->will($this->returnValue($session));
$app['EM']->expects($this->exactly(4))->method('persist')->will($this->returnValue(null));
$app['EM']->expects($this->exactly(2))->method('flush')->will($this->returnValue(null));
$app['phraseanet.configuration']['session'] = array(
'idle' => 0,

View File

@@ -40,7 +40,6 @@ class PhraseanetPHPUnitListener implements PHPUnit_Framework_TestListener
public function startTest(PHPUnit_Framework_Test $test)
{
echo $test->getName() . "\n";
return;
}