Beispiel #1
0
 /**
  * @param HHPnet\Core\Domain\Albums\Album $album
  * @param MongoDB\DeleteResult            $delete_result
  */
 public function it_is_possible_to_remove_given_album(Album $album, \MongoDB\DeleteResult $delete_result)
 {
     $delete_result->getDeletedCount()->willReturn(1);
     $this->collection->deleteOne(Argument::any())->willReturn($delete_result);
     $album->getId()->willReturn(1);
     $this->remove($album)->shouldBe(true);
 }
Beispiel #2
0
 /**
  * @param \HHPnet\Core\Domain\Albums\Album  $album
  * @param HHPnet\Core\Domain\Groups\GroupId $group_id
  */
 public function let(Album $album, GroupId $group_id)
 {
     $group_id->__toString()->willReturn('1');
     $album->getId()->willReturn(1);
     $album->getGroupId()->willReturn($group_id);
     $album->getName()->willReturn('album_name');
     $album->getDescription()->willReturn('album_description');
     $album->getReleaseYear()->willReturn(2001);
     $this->beConstructedWith($album);
 }
Beispiel #3
0
 /**
  * @param Album $album
  *
  * @return bool
  */
 public function remove(Album $album)
 {
     return 1 === $this->collection->deleteOne(['_id' => $album->getId()])->getDeletedCount();
 }