for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace DocLister\Tests\MODxAPI;
use DocLister\Tests\ModxAbstract;
abstract class apiAbstract extends ModxAbstract
{
/** @var \MODxAPI */
protected $api = null;
public function setUp()
parent::setUp();
$this->api = $this->mockMODxAPI();
}
protected function mockMODxAPI()
/** @var \MODxAPI|\PHPUnit_Framework_MockObject_MockObject $api */
$api = $this->getMockForAbstractClass('MODxAPI', array($this->modx));
$api->expects($this->any())
->method('edit')
->will($this->returnValue($api));
->method('save')
->will($this->returnValue($api->getID())); //$this->id || false
->method('delete')
->will($this->returnValue(true));
return $api;
protected function mockModUsers()
$obj = $this->getMock('modUsers', null, array($this->modx));
return $obj;