Exemplo n.º 1
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);
 }
Exemplo n.º 2
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);
 }