/** * @expectedException \DomainException * @expectedExceptionMessage No valid answer can be generated from the current rules set. */ public function testDomainExceptionIsThrownOnEmptyGameRules() { $this->sut->expects($this->once())->method('toArray')->will($this->returnValue(new ArrayCollection())); $this->sut->generateValidAnswer(1); }