<?php

namespace MockaTests\Mocka;
use Mocka;

class ClassTraitTest extends \PHPUnit_Framework_TestCase {

    public function testCallMockedMethod() {
        $mocka = new Mocka();
        /** @var \MockaMocks\AbstractClass $object */
        $object = $mocka->mockObject('\MockaMocks\AbstractClass');
        $this->assertNull($object->foo());
        $this->assertSame('foo', $object->bar());
    }

}

<?php

namespace MockaTests\Mocka;
use Mocka;

class ClassTraitTest extends \PHPUnit_Framework_TestCase {

    public function testCallMockedMethod() {
        $mocka = new Mocka();
        $className = $mocka->mockClass('\MockaMocks\AbstractClass');
        /** @var \MockaMocks\AbstractClass $object */
        $object = new $className();
        $this->assertNull($object->foo());
        $this->assertSame('foo', $object->bar());
        

    }

}

Use mockClass instead of mockObject
Use mockClass instead of mockObject
