Пример #1
0
 public function let(CollegeInterface $repository, CollegeFactory $factory)
 {
     $college_to_save = new CollegeEntity();
     $factory->collegeEntity(array())->willReturn($college_to_save);
     $college_to_save_that_fails = new CollegeEntity();
     $college_to_save_that_fails->setName('Test');
     $college_to_save_that_fails->setNickname('Test');
     $factory->collegeEntity(array('name' => 'fails'))->willReturn($college_to_save_that_fails);
     $college_saved = new CollegeEntity();
     $college_saved->setName('Test');
     $college_saved->setNickname('Test');
     $repository->getByName(Argument::any())->willReturn($college_saved);
     $repository->save($college_to_save)->willReturnArgument(0);
     $this->beConstructedWith($repository, $factory);
 }