Browse Source

fix test for playlist

Bastien Sevajol 11 years ago
parent
commit
d6b86d3c42

+ 3 - 1
src/Muzich/CoreBundle/Tests/lib/Security/ContextTestCases.php View File

341
   
341
   
342
   public function playlistCreateResponseIs($success, $condition)
342
   public function playlistCreateResponseIs($success, $condition)
343
   {
343
   {
344
-    $this->playlistCreate(0, 'my_super_playlist');
344
+    $element = $this->test->findOneBy('Element', 'SOULFLY - Prophecy');
345
+    $this->playlistCreate($element->getId(), 'my_super_playlist');
345
     return $this->ajaxResponseSatisfyConditions(
346
     return $this->ajaxResponseSatisfyConditions(
346
       $this->test->getClient()->getResponse()->getContent(),
347
       $this->test->getClient()->getResponse()->getContent(),
347
       $success, 
348
       $success, 
357
     )));
358
     )));
358
     
359
     
359
     $response = json_decode($this->test->client->getResponse()->getContent(), true);
360
     $response = json_decode($this->test->client->getResponse()->getContent(), true);
361
+    $this->test->assertTrue(array_key_exists('data', $response));
360
     $crawler = new Crawler($response['data']);
362
     $crawler = new Crawler($response['data']);
361
     
363
     
362
     $extract = $crawler->filter('input[name="playlist[_token]"]')
364
     $extract = $crawler->filter('input[name="playlist[_token]"]')

+ 1 - 1
src/Muzich/CoreBundle/lib/FunctionalTest.php View File

540
    * @param array $params
540
    * @param array $params
541
    * @return object 
541
    * @return object 
542
    */
542
    */
543
-  protected function findOneBy($entityName, $params)
543
+  public function findOneBy($entityName, $params)
544
   {
544
   {
545
     if (!is_array($params))
545
     if (!is_array($params))
546
     {
546
     {

+ 0 - 0
web/img/1372889556_random_shuffle.png View File