. */ namespace Doctrine\Tests\Mocks; use Doctrine\Common\Cli\AbstractNamespace; /** * TaskMock used for testing the CLI interface. * @author Nils Adermann */ class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask { /** * Since instances of this class can be created elsewhere all instances * register themselves in this array for later inspection. * * @var array(TaskMock) */ static public $instances = array(); private $runCounter = 0; /** * Constructor of Task Mock Object. * Makes sure the object can be inspected later. * * @param AbstractNamespace CLI Namespace, passed to parent constructor */ function __construct(AbstractNamespace $namespace) { self::$instances[] = $this; parent::__construct($namespace); } /** * Returns the number of times run() was called on this object. * * @return int */ public function getRunCounter() { return $this->runCounter; } /* Mock API */ /** * Method invoked by CLI to run task. */ public function run() { $this->runCounter++; } /** * Method supposed to generate the CLI Task Documentation */ public function buildDocumentation() { } }