/** * @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\Groups\Group $group */ public function let(Group $group) { $group->getId()->willReturn(1); $group->getName()->willReturn('name'); $group->getCountry()->willReturn('country'); $group->getBio()->willReturn('bio'); $this->beConstructedWith($group); }
/** * @return string */ public function bio() { return $this->group->getBio(); }
/** * @param Group $group * * @return bool */ public function remove(Group $group) { return 1 === $this->collection->deleteOne(['_id' => $group->getId()])->getDeletedCount(); }