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,7 +341,8 @@ class ContextTestCases
341 341
   
342 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 346
     return $this->ajaxResponseSatisfyConditions(
346 347
       $this->test->getClient()->getResponse()->getContent(),
347 348
       $success, 
@@ -357,6 +358,7 @@ class ContextTestCases
357 358
     )));
358 359
     
359 360
     $response = json_decode($this->test->client->getResponse()->getContent(), true);
361
+    $this->test->assertTrue(array_key_exists('data', $response));
360 362
     $crawler = new Crawler($response['data']);
361 363
     
362 364
     $extract = $crawler->filter('input[name="playlist[_token]"]')

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

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

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