Does anybody know how to use PHPUnit's mocking functionality with Yii?


I want to checkout the Mocking functionality from PHPUnit. I’ve heard that it should be very useful.

So I’ve played around a bit:

        public function testBlar(){

        $stub = $this->getMockBuilder('\app\controllers\NonStaticClass')



        $debug = $stub->method('foo')


        $debug = true;


Like in the example at

But I’m getting

Has anybody an idea what goes wrong here? My Controller can be definitely found.