Пример #1
0
 /**
  * @expectedException \DomainException
  */
 public function testPersistDuplicateFee()
 {
     $fee = new EntranceFee();
     $db = clone $fee;
     $db->setId(new \MongoId());
     $this->repository->expects($this->once())->method('findOne')->with(['-class' => 'fee'])->willReturn($db);
     $this->repository->expects($this->never())->method('persist');
     $this->sut->persistEntranceFee($fee);
 }
Пример #2
0
 public function testWarmupWithDatabase()
 {
     $this->repository->expects($this->once())->method('findOne')->with(['-class' => 'config'])->willReturn(new \Trismegiste\SocialBundle\Config\ParameterBag(['database' => 789]));
     $this->sut->warmUp(sys_get_temp_dir());
     $this->assertEquals(['database' => 789], $this->sut->read());
 }