Esempio n. 1
0
 public function testCodeceptionRun()
 {
     $task = new \Robo\Task\Testing\Codecept('codecept.phar');
     $task->setLogger(new \Psr\Log\NullLogger());
     $task->run();
     $this->codecept->verifyInvoked('executeCommand');
 }
Esempio n. 2
0
 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']);
 }
Esempio n. 3
0
 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");
 }
Esempio n. 4
0
 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']);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public function testServerRun()
 {
     $task = new \Robo\Task\Development\PhpServer('8000');
     $task->setLogger(new \Psr\Log\NullLogger());
     $task->run();
     $this->process->verifyInvoked('run');
 }
Esempio n. 7
0
 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']);
 }
Esempio n. 8
0
 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']);
 }
Esempio n. 9
0
 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']);
 }
Esempio n. 10
0
File: HgTest.php Progetto: jjok/Robo
 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']);
 }
Esempio n. 11
0
 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");
 }
Esempio n. 12
0
 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]);
 }
Esempio n. 13
0
 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');
 }
Esempio n. 14
0
 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');
     });
 }
Esempio n. 15
0
 public function testCodeceptionRun()
 {
     $this->taskCodecept()->run();
     $this->codecept->verifyInvoked('executeCommand', ['vendor/bin/codecept run']);
 }
Esempio n. 16
0
 public function testSvnStackRun()
 {
     $this->taskSvnStack('svn')->update()->add()->run();
     $this->svn->verifyInvoked('taskExec', ['svn add ']);
     $this->svn->verifyInvoked('taskExec', ['svn update ']);
 }
Esempio n. 17
0
 public function testExecStack()
 {
     $this->taskExecStack()->exec('ls')->exec('cd /')->exec('cd home')->run();
     $this->process->verifyInvoked('run', 3);
 }
Esempio n. 18
0
 public function testSvnStackRun()
 {
     $this->svn->construct()->update()->add()->run();
     $this->svn->verifyInvoked('executeCommand', ['svn update && svn add']);
 }
Esempio n. 19
0
 public function testServerRun()
 {
     $this->taskServer('8000')->run();
     $this->process->verifyInvoked('run');
 }
Esempio n. 20
0
 public function testCodeceptionRun()
 {
     $this->taskCodecept()->run();
     $this->codecept->verifyInvoked('executeCommand', [$this->command]);
 }