/** * @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); }
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()); }