X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FMocks%2FTaskMock.php;fp=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FMocks%2FTaskMock.php;h=be6de9cca593715b85a27eae2dcda67a9b7a0ea8;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fgalerie.git diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/TaskMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/TaskMock.php new file mode 100644 index 0000000..be6de9c --- /dev/null +++ b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/TaskMock.php @@ -0,0 +1,81 @@ +. + */ + +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() + { + } +}