public function testFactorOutput() { $bench = new TimeBenchmark(); sleep(1); $bench->end(); $this->assertGreaterThanOrEqual(1, $bench->getTime(TimeBenchmark::SECONDS)); $this->assertGreaterThanOrEqual(1000, $bench->getTime(TimeBenchmark::MILLISECONDS)); $this->assertGreaterThanOrEqual(1000000, $bench->getTime(TimeBenchmark::MICROSECONDS)); }
protected function doExecute($input, $output) { $bench = new TimeBenchmark(); $this->withoutTest = $input->getOption('without-test'); $modes = $input->getArgument('mode'); $qnd = (bool) $input->getOption('qnd'); $container = $this->createWebforgeContainer(); $this->cliProject = $cliProject = $container->getLocalProject(); foreach ($modes as $mode) { $project = clone $cliProject; $this->initProperties($mode, $project); $this->initProject($project); $deployer = $this->createDeployer(new Dir($input->getOption('deploymentsDir') ?: 'D:\\www\\deployments\\'), $project, $mode, $container); $deployer->setBaseUrl($this->baseUrl); if (!$qnd) { $this->updateComposer($project); } $this->initTasks($deployer, $project, $mode, $container); $deployer->deploy(); $this->remoteSync($mode); $this->remoteUpdateComposer($mode, $project); $this->remoteRefreshAPC($mode, $project); $this->remoteUpdateDB($mode, $project); $this->remoteRunTests($mode, $project); $this->afterDeploy($deployer, $project, $mode, $container, $input, $output); $this->info('deployment finished in ' . $bench->stop()); return 0; } }