/** * @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); }
/** * @param HHPnet\Core\Domain\Groups\Group $group * @param MongoDB\DeleteResult $delete_result */ public function it_is_possible_to_remove_given_group(\HHPnet\Core\Domain\Groups\Group $group, \MongoDB\DeleteResult $delete_result) { $delete_result->getDeletedCount()->willReturn(1); $this->collection->deleteOne(Argument::any())->willReturn($delete_result); $group->getId()->willReturn(1); $this->remove($group)->shouldBe(true); }
/** * @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); }
/** * @depends testUnacknowledgedWriteConcern * @expectedException MongoDB\Exception\BadMethodCallException * @expectedExceptionMessageRegExp /[\w:\\]+ should not be called for an unacknowledged write result/ */ public function testUnacknowledgedWriteConcernAccessesDeletedCount(DeleteResult $result) { $result->getDeletedCount(); }