mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
Fix unit tests
This commit is contained in:
@@ -105,6 +105,7 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
|||||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class Application extends SilexApplication
|
class Application extends SilexApplication
|
||||||
{
|
{
|
||||||
@@ -523,7 +524,7 @@ class Application extends SilexApplication
|
|||||||
|
|
||||||
public function bindRoutes()
|
public function bindRoutes()
|
||||||
{
|
{
|
||||||
$this->get('/', function(PhraseaApplication $app) {
|
$this->get('/', function(Application $app) {
|
||||||
if ($app['browser']->isMobile()) {
|
if ($app['browser']->isMobile()) {
|
||||||
return $app->redirect("/login/?redirect=lightbox");
|
return $app->redirect("/login/?redirect=lightbox");
|
||||||
} elseif ($app['browser']->isNewGeneration()) {
|
} elseif ($app['browser']->isNewGeneration()) {
|
||||||
@@ -533,7 +534,7 @@ class Application extends SilexApplication
|
|||||||
}
|
}
|
||||||
})->bind('root');
|
})->bind('root');
|
||||||
|
|
||||||
$this->get('/robots.txt', function(PhraseaApplication $app) {
|
$this->get('/robots.txt', function(Application $app) {
|
||||||
|
|
||||||
if ($app['phraseanet.registry']->get('GV_allow_search_engine') === true) {
|
if ($app['phraseanet.registry']->get('GV_allow_search_engine') === true) {
|
||||||
$buffer = "User-Agent: *\n" . "Allow: /\n";
|
$buffer = "User-Agent: *\n" . "Allow: /\n";
|
||||||
|
@@ -127,12 +127,12 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
|||||||
return $browser;
|
return $browser;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$app['notification.deliverer'] = $this->getMockBuilder('Alchemy\Phrasea\Notification\Deliverer')
|
$app['notification.deliverer'] = $phpunit->getMockBuilder('Alchemy\Phrasea\Notification\Deliverer')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app['notification.deliverer']->expects($this->any())
|
$app['notification.deliverer']->expects($phpunit->any())
|
||||||
->method('deliver')
|
->method('deliver')
|
||||||
->will($this->returnCallback(function() use ($phpunit){
|
->will($phpunit->returnCallback(function() use ($phpunit){
|
||||||
$phpunit->fail('Notification deliverer must be mocked');
|
$phpunit->fail('Notification deliverer must be mocked');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user