Example #1
0
 /**
  * @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);
 }
Example #2
0
 /**
  * @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);
 }
Example #3
0
 /**
  * @return string
  */
 public function bio()
 {
     return $this->group->getBio();
 }
Example #4
0
 /**
  * @param Group $group
  *
  * @return bool
  */
 public function remove(Group $group)
 {
     return 1 === $this->collection->deleteOne(['_id' => $group->getId()])->getDeletedCount();
 }