mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Fix tests
This commit is contained in:
@@ -123,6 +123,7 @@ class Application extends SilexApplication
|
||||
$twig->addFilter('formatOctets', new \Twig_Filter_Function('p4string::format_octets'));
|
||||
$twig->addFilter('geoname_name_from_id', new \Twig_Filter_Function('geonames::name_from_id'));
|
||||
$twig->addFilter('base_from_coll', new \Twig_Filter_Function('phrasea::baseFromColl'));
|
||||
$twig->addFilter('AppName', new \Twig_Filter_Function('Alchemy\Phrasea\Controller\Admin\ConnectedUsers::appName'));
|
||||
|
||||
return $twig;
|
||||
}));
|
||||
|
@@ -34,9 +34,6 @@ class ConnectedUsers implements ControllerProviderInterface
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->get('/', function(Application $app, Request $request) {
|
||||
|
||||
$app['twig']->addFilter('AppName', new \Twig_Filter_Function(__CLASS__ . '::appName'));
|
||||
|
||||
return new Response(
|
||||
$app['twig']->render(
|
||||
'admin/connected-users.html.twig', array('datas' => \Session_Handler::get_active_sessions()
|
||||
|
@@ -169,26 +169,23 @@ class RecordsRequestTest extends \PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function testSimpleBasket()
|
||||
{
|
||||
$basket = $this->getBasket();
|
||||
$request = new Request(array('ssel' => $basket->getId()));
|
||||
$basketElement = $this->insertOneBasketElement();
|
||||
$request = new Request(array('ssel' => $basketElement->getBasket()->getId()));
|
||||
|
||||
$records = RecordsRequest::fromRequest($this->getApplication(), $request);
|
||||
|
||||
$this->assertEquals(2, count($records));
|
||||
$this->assertEquals(4, count($records->received()));
|
||||
$this->assertEquals(1, count($records));
|
||||
$this->assertEquals(1, count($records->received()));
|
||||
$this->assertEquals(0, count($records->stories()));
|
||||
$this->assertNull($records->singleStory());
|
||||
$this->assertFalse($records->isSingleStory());
|
||||
$this->assertEquals($basket, $records->basket());
|
||||
$this->assertEquals($basketElement->getBasket(), $records->basket());
|
||||
|
||||
$serialized = $records->serializedList();
|
||||
$exploded = explode(';', $serialized);
|
||||
|
||||
$this->assertEquals(2, count($exploded));
|
||||
$this->assertContains(self::$records['record_24']->get_serialize_key(), $exploded);
|
||||
$this->assertContains(self::$records['record_2']->get_serialize_key(), $exploded);
|
||||
$this->assertNotContains(self::$records['record_no_access']->get_serialize_key(), $exploded);
|
||||
$this->assertNotContains(self::$records['record_no_access_by_status']->get_serialize_key(), $exploded);
|
||||
$this->assertEquals(1, count($exploded));
|
||||
$this->assertContains($basketElement->getRecord()->get_serialize_key(), $exploded);
|
||||
}
|
||||
|
||||
public function getBasket()
|
||||
|
Reference in New Issue
Block a user