|
@@ -403,7 +403,7 @@ class PlaylistControllerTest extends FunctionalTest
|
403
|
403
|
|
404
|
404
|
protected function checkPlaylistOwnedBy($playlist, $user)
|
405
|
405
|
{
|
406
|
|
- $this->assertEquals($playlist->getOwner()->getId(), $user->getId());
|
|
406
|
+ $this->assertEquals($playlist->getOwner()->getUsername(), $user->getUsername());
|
407
|
407
|
}
|
408
|
408
|
|
409
|
409
|
protected function checkPlaylistNotOwnedBy($playlist, $user)
|
|
@@ -425,6 +425,26 @@ class PlaylistControllerTest extends FunctionalTest
|
425
|
425
|
$this->checkPlaylistOwnedBy($this->playlists['bux_bob_pub'], $this->users['bux']);
|
426
|
426
|
}
|
427
|
427
|
|
|
428
|
+ public function testCopyWhenPickedPlaylistPrivatized()
|
|
429
|
+ {
|
|
430
|
+ $this->init();
|
|
431
|
+ $this->initCopysContextData();
|
|
432
|
+ $this->connectUser('bob', 'toor');
|
|
433
|
+
|
|
434
|
+ $this->checkPlaylistPickedBy($this->playlists['bob_pub'], $this->users['bux']);
|
|
435
|
+ $this->checkPlaylistNotOwnedBy($this->playlists['bob_pub'], $this->users['bux']);
|
|
436
|
+
|
|
437
|
+ $this->playlists['bob_pub']->setPublic(false);
|
|
438
|
+ $this->updatePlaylist($this->playlists['bob_pub']);
|
|
439
|
+ $this->playlists['bux_bob_pub'] = $this->findOneBy('Playlist', array(
|
|
440
|
+ 'name' => 'A travers l\'espace',
|
|
441
|
+ 'owner' => $this->users['bux']->getId()
|
|
442
|
+ ));
|
|
443
|
+ $this->assertTrue(!is_null($this->playlists['bux_bob_pub']));
|
|
444
|
+ $this->assertEquals(false, $this->playlists['bux_bob_pub']->isPublic());
|
|
445
|
+ $this->checkPlaylistOwnedBy($this->playlists['bux_bob_pub'], $this->users['bux']);
|
|
446
|
+ }
|
|
447
|
+
|
428
|
448
|
protected function deletePlaylist($playlist)
|
429
|
449
|
{
|
430
|
450
|
$this->tests_cases->playlistDelete($playlist->getId());
|
|
@@ -463,7 +483,7 @@ class PlaylistControllerTest extends FunctionalTest
|
463
|
483
|
|
464
|
484
|
public function testUpdate()
|
465
|
485
|
{
|
466
|
|
- $this->init();
|
|
486
|
+ $this->init();
|
467
|
487
|
$this->initReadContextData();
|
468
|
488
|
$this->connectUser('bux', 'toor');
|
469
|
489
|
$this->goToPage($this->generateUrl('playlist', array('user_slug' => $this->users['bux']->getSlug(), 'playlist_id' => $this->playlists['bux_1_pub']->getId())));
|
|
@@ -487,6 +507,7 @@ class PlaylistControllerTest extends FunctionalTest
|
487
|
507
|
|
488
|
508
|
$form = $this->selectForm('form.playlist_edit input[type="submit"]');
|
489
|
509
|
$form['playlist[name]'] = $playlist->getName();
|
|
510
|
+ $form['playlist[public]'] = $playlist->isPublic();
|
490
|
511
|
$this->submit($form);
|
491
|
512
|
}
|
492
|
513
|
|