예제 #1
0
 /**
  * @param HHPnet\Core\Domain\Videos\Video $video
  * @param MongoDB\DeleteResult            $delete_result
  */
 public function it_is_possible_to_remove_given_video(\HHPnet\Core\Domain\Videos\Video $video, \MongoDB\DeleteResult $delete_result)
 {
     $delete_result->getDeletedCount()->willReturn(1);
     $this->collection->deleteOne(Argument::any())->willReturn($delete_result);
     $video->getId()->willReturn(1);
     $this->remove($video)->shouldBe(true);
 }
예제 #2
0
 /**
  * @param \HHPnet\Core\Domain\Videos\Video $video
  */
 public function let(Video $video)
 {
     $video->getId()->willReturn(1);
     $video->getVideoServiceId()->willReturn('video_service_id');
     $video->getVideoService()->willReturn('video_service');
     $video->getTitle()->willReturn('title');
     $video->getDescription()->willReturn('description');
     $this->beConstructedWith($video);
 }
예제 #3
0
 /**
  * @return string
  */
 public function description()
 {
     return $this->video->getDescription();
 }
예제 #4
0
 /**
  * @param Video $video
  *
  * @return bool
  */
 public function remove(Video $video)
 {
     return 1 === $this->collection->deleteOne(['_id' => $video->getId()])->getDeletedCount();
 }