Пример #1
0
 public function let(ConferenceInterface $repository, ConferenceFactory $factory)
 {
     $conference = new ConferenceEntity();
     $repository->getById(Argument::any())->willReturn($conference);
     $repository->getByUrl(Argument::any())->willReturn($conference);
     $this->beConstructedWith($repository, $factory);
 }
Пример #2
0
 public function let(ConferenceInterface $repository, ConferenceFactory $factory)
 {
     $repository->getById(null)->willReturn(new ConferenceEntity());
     $repository->getById('non_existing')->willReturn(false);
     $repository->remove(Argument::any())->willReturn(true);
     $this->beConstructedWith($repository, $factory);
 }
Пример #3
0
 public function let(ConferenceInterface $repository, ConferenceFactory $factory)
 {
     $conference_to_save = new ConferenceEntity();
     $factory->conferenceEntity(array())->willReturn($conference_to_save);
     $conference_to_save_that_fails = new ConferenceEntity();
     $conference_to_save_that_fails->setName('Test');
     $factory->conferenceEntity(array('name' => 'fails'))->willReturn($conference_to_save_that_fails);
     $repository->getByName(null)->willReturn(false);
     $repository->save($conference_to_save)->willReturnArgument(0);
     $this->beConstructedWith($repository, $factory);
 }
Пример #4
0
 public function let(ConferenceInterface $repository, ConferenceFactory $factory)
 {
     $conference_to_save = new ConferenceEntity();
     $factory->conferenceEntity(array())->willReturn($conference_to_save);
     $non_existing_conference = new ConferenceEntity();
     $non_existing_conference->setId('non_existing');
     $factory->conferenceEntity(array('name' => 'fails'))->willReturn($non_existing_conference);
     $repository->getById(null)->willReturn(true);
     $repository->getById('non_existing')->willReturn(false);
     $repository->save(Argument::any())->willReturnArgument(0);
     $this->beConstructedWith($repository, $factory);
 }
Пример #5
0
 public function let(ConferenceInterface $repository, ConferenceFactory $factory)
 {
     $repository->listAll(0, 25)->willReturn(new ConferenceIterator(array(1, 2)));
     $repository->setQueryParams(Argument::any(), Argument::any())->willReturn(true);
     $this->beConstructedWith($repository, $factory);
 }