getMockBuilder('Fhaculty\Graph\Walk') ->disableOriginalConstructor() ->getMock(); $exception = new NegativeCycleException('test', 0, null, $cycle); $this->assertEquals('test', $exception->getMessage()); $this->assertEquals($cycle, $exception->getCycle()); } }