## EXAMPLES # Download WordPress core $ wp core download --locale=nl_NL Downloading WordPress 4.5.2 (nl_NL)... md5 hash verified: c5366d05b521831dd0b29dfc386e56a5 Success: WordPress downloaded. # Install WordPress $ wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword --admin_email=info@example.com Success: WordPress installed successfully. # Display the WordPress version $ wp core version 4.5.2
Inheritance: extends WP_CLI_Command
 public function eventAfterTestFail(Core_Command $command)
 {
     if (strpos($command->getOutput(), 'PHPUnit_Extensions_Selenium2TestCase_NoSeleniumException') !== false) {
         if ($command->getTryCounter() == 1) {
             $command->retry();
         }
     }
     return $command;
 }
示例#2
0
 /**
  * Build phpunit command before execute
  *
  */
 protected function buildCommand()
 {
     $isSilent = $this->PUOptions[self::CFG_SHOW_ERROR];
     $uuid = uniqid(date('YmdHis'));
     $pluginList = $this->eventListener->getByEvent(Core_Plugin::EVENT_COMMAND_BUILD_PARAMS);
     $cmdIndex = 0;
     foreach ($this->testFiles as $filename) {
         /** @var $plugin Core_Plugin */
         $extParameters = [''];
         foreach ($pluginList as $plugin) {
             //work only one plugin
             $extParameters = $plugin->eventCommandBuild($filename);
         }
         if (empty($extParameters)) {
             $extParameters = [''];
         }
         foreach ($extParameters as $paramStr) {
             $cmdline = '';
             $outtmp = PATH_TMP . "/result.%command.index%.tmp.log";
             $outlog = PATH_TMP . "/result.%command.index%.out.succ.log";
             $outfail = PATH_TMP . "/result.%command.index%.out.fail.log";
             $cmdSucc = "mv {$outtmp} {$outlog}";
             $cmdFail = "mv {$outtmp} {$outfail}";
             if (!$isSilent) {
                 $cmdSucc .= " && cat {$outlog}";
             }
             $cmdline .= "echo '[INFO][idx:%command.index%][filename:{$filename}][time:'`date +\"%Y-%m-%d %T\"`'][thread:#thread_id#]' &&";
             $cmdline .= ' cd ' . getcwd() . ' && ';
             $cmdline .= $this->PUOptions[self::CFG_PHPUNIT_CMD] . ' -d parallel-phpunit-thread=#thread_id# ' . '-d run-uuid=' . $uuid . ' ' . sprintf($this->buildArguments(), $cmdIndex) . ' %ext_param% ' . $filename;
             $cmdline .= ' > ' . "{$outtmp} &&  test \"\$?\"==0&&({$cmdSucc}) || ( {$cmdFail} )2>&1 &";
             $line = str_replace(['%command.index%', '%ext_param%'], [$cmdIndex, $paramStr], $cmdline);
             $command = new Core_Command($line);
             $command->setTestFile($filename);
             $this->commandList[] = $command;
             $cmdIndex++;
         }
     }
 }