. * */ namespace OCA\News\Utility; /** * Simple utility class for testing anything using an api */ abstract class TestUtility extends \PHPUnit_Framework_TestCase { /** * Boilerplate function for getting an API Mock class * @param string $apiClass the class inclusive namespace of the api that we * want to use * @param array $constructor constructor parameters of the api class */ protected function getAPIMock($apiClass='OCA\News\Core\API', array $constructor=array('appname')){ $methods = get_class_methods($apiClass); return $this->getMock($apiClass, $methods, $constructor); } }