phpunit

モデルのスタブ

getMockBuilder('Post') ->setConstructorArgs(array(false, 'posts', 'test')) ->setMethods(array('doSomething')) ->getMock(); $stub->expects($this->any()) ->method('doSomething') ->will($this->returnValue('foo'));

CLIの場合、テストを省略

PHPUnit – The PHP Testing Framework markTestSkipped('Could not execute ' . __METHOD__ . ' in CLI'); }