public function testCodeceptionRun() { $task = new \Robo\Task\Testing\Codecept('codecept.phar'); $task->setLogger(new \Psr\Log\NullLogger()); $task->run(); $this->codecept->verifyInvoked('executeCommand'); }
public function testAtoumCommand() { $task = (new \Robo\Task\Testing\Atoum('atoum'))->bootstrap('bootstrap.php')->tags("needDb")->lightReport()->tap()->bootstrap('tests/bootstrap.php')->configFile("config/dev.php")->debug()->files(array("path/to/file1.php", "path/to/file2.php"))->directories("tests/units"); verify($task->getCommand())->equals('atoum --bootstrap bootstrap.php --tags needDb --use-light-report --use-tap-report --bootstrap tests/bootstrap.php -c config/dev.php --debug --f path/to/file1.php --f path/to/file2.php --directories tests/units'); $task->run(); $this->atoum->verifyInvoked('executeCommand', ['atoum --bootstrap bootstrap.php --tags needDb --use-light-report --use-tap-report --bootstrap tests/bootstrap.php -c config/dev.php --debug --f path/to/file1.php --f path/to/file2.php --directories tests/units']); }
public function testParallelExec() { $result = $this->taskParallelExec()->process('ls 1')->process('ls 2')->process('ls 3')->run(); $this->process->verifyInvokedMultipleTimes('start', 3); verify($result->getExitCode())->equals(0); $this->guy->seeInOutput("3 processes ended in 0.00 s"); }
public function testPHPUnitCommand() { $task = $this->taskPHPUnit('phpunit')->bootstrap('bootstrap.php')->filter('Model')->group('important')->xml('result.xml')->debug(); verify($task->getCommand())->equals('phpunit --bootstrap bootstrap.php --filter Model --group important --log-junit result.xml --debug'); $task->run(); $this->phpunit->verifyInvoked('executeCommand', ['phpunit --bootstrap bootstrap.php --filter Model --group important --log-junit result.xml --debug']); }
public function testExecStack() { $task = new \Robo\Task\Base\ExecStack(); $task->setLogger(new \Psr\Log\NullLogger()); $task->exec('ls')->exec('cd /')->exec('cd home')->run(); $this->process->verifyInvoked('run', 3); }
public function testServerRun() { $task = new \Robo\Task\Development\PhpServer('8000'); $task->setLogger(new \Psr\Log\NullLogger()); $task->run(); $this->process->verifyInvoked('run'); }
public function testPHPSpecCommand() { $task = $this->taskPhpspec('phpspec')->stopOnFail()->noCodeGeneration()->quiet()->verbose('vv')->noAnsi()->noInteraction()->format('pretty'); verify($task->getCommand())->equals('phpspec run --stop-on-failure --no-code-generation --quiet -vv --no-ansi --no-interaction --format pretty'); $task->run(); $this->phpspec->verifyInvoked('executeCommand', ['phpspec run --stop-on-failure --no-code-generation --quiet -vv --no-ansi --no-interaction --format pretty']); }
public function testGitStackRun() { (new \Robo\Task\Vcs\GitStack('git'))->stopOnFail()->add('-A')->pull()->run(); $this->git->verifyInvoked('executeCommand', ['git add -A']); $this->git->verifyInvoked('executeCommand', ['git pull']); (new \Robo\Task\Vcs\GitStack('git'))->add('-A')->pull()->run(); $this->git->verifyInvoked('executeCommand', ['git add -A && git pull']); }
public function testGitStackRun() { $this->taskGitStack('git')->stopOnFail()->add('-A')->pull()->run(); $this->git->verifyInvoked('executeCommand', ['git add -A']); $this->git->verifyInvoked('executeCommand', ['git pull']); $this->taskGitStack('git')->add('-A')->pull()->run(); $this->git->verifyInvoked('executeCommand', ['git add -A ; git pull']); }
public function testHgStackRun() { $this->hgStack->stopOnFail()->add()->pull()->run(); $this->hg->verifyInvoked('executeCommand', ['hg add']); $this->hg->verifyInvoked('executeCommand', ['hg pull']); (new \Robo\Task\Vcs\HgStack('hg'))->add()->pull()->run(); $this->hg->verifyInvoked('executeCommand', ['hg add && hg pull']); }
public function testParallelExec() { $task = new \Robo\Task\Base\ParallelExec(); $task->setLogger($this->guy->logger()); $result = $task->process('ls 1')->process('ls 2')->process('ls 3')->run(); $this->process->verifyInvokedMultipleTimes('start', 3); verify($result->getExitCode())->equals(0); $this->guy->seeInOutput("3 processes finished"); }
public function testPHPUnitCommand() { // need an explicit Traversable $skippedPaths = new \SplDoublyLinkedList(); $skippedPaths->push('a'); $skippedPaths->push('b'); // going for 'bang for the buck' here re: test converage $task = (new \Robo\Task\ApiGen\ApiGen('apigen'))->config('./apigen.neon')->source('src')->extensions('php')->exclude(array('test', 'tmp'))->skipDocPath($skippedPaths)->charset(array('utf8', 'iso88591'))->internal('no')->php(true)->tree('Y')->debug('n'); $cmd = 'apigen --config ./apigen.neon --source src --extensions php --exclude test --exclude tmp --skip-doc-path a --skip-doc-path b --charset \'utf8,iso88591\' --internal no --php yes --tree yes --debug no'; verify($task->getCommand())->equals($cmd); $task->run(); $this->apigen->verifyInvoked('executeCommand', [$cmd]); }
public function testVerifyClassMethodCalled() { $user = new UserModel(); $userProxy = new ClassProxy('demo\\UserModel'); double::registerClass('demo\\UserModel'); $user->setName('davert'); $user->setName('jon'); $userProxy->verifyInvokedMultipleTimes('setName', 2); $userProxy->verifyInvokedOnce('setName', ['jon']); $userProxy->verifyNeverInvoked('save'); $userProxy->verifyNeverInvoked('setName', ['bob']); verify($user->getName())->equals('jon'); }
public function testVerifyMagicMethods() { $this->specify('works for class proxy', function () { // Set up user object. double::registerClass("demo\\UserModel", ['renameUser' => "Bob Jones", 'save' => null]); $userProxy = new ClassProxy("demo\\UserModel"); $user = new UserModel(['name' => "John Smith"]); // Rename the user via magic method. UserService::renameStatic($user, "Bob Jones"); // Assert rename was counted. $userProxy->verifyInvoked('renameUser'); }); $this->specify('works for instance proxy', function () { // Set up user object. $user = new UserModel(['name' => "John Smith"]); double::registerObject($user); $user = new InstanceProxy($user); // Rename the user via magic method. $user->renameUser("Bob Jones"); // Assert rename was counted. $user->verifyInvoked('renameUser'); }); }
public function testCodeceptionRun() { $this->taskCodecept()->run(); $this->codecept->verifyInvoked('executeCommand', ['vendor/bin/codecept run']); }
public function testSvnStackRun() { $this->taskSvnStack('svn')->update()->add()->run(); $this->svn->verifyInvoked('taskExec', ['svn add ']); $this->svn->verifyInvoked('taskExec', ['svn update ']); }
public function testExecStack() { $this->taskExecStack()->exec('ls')->exec('cd /')->exec('cd home')->run(); $this->process->verifyInvoked('run', 3); }
public function testSvnStackRun() { $this->svn->construct()->update()->add()->run(); $this->svn->verifyInvoked('executeCommand', ['svn update && svn add']); }
public function testServerRun() { $this->taskServer('8000')->run(); $this->process->verifyInvoked('run'); }
public function testCodeceptionRun() { $this->taskCodecept()->run(); $this->codecept->verifyInvoked('executeCommand', [$this->command]); }