当前位置: 首页>>代码示例>>PHP>>正文


PHP ApplicationTester::getDisplay方法代码示例

本文整理汇总了PHP中Symfony\Component\Console\Tester\ApplicationTester::getDisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationTester::getDisplay方法的具体用法?PHP ApplicationTester::getDisplay怎么用?PHP ApplicationTester::getDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Console\Tester\ApplicationTester的用法示例。


在下文中一共展示了ApplicationTester::getDisplay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: exec

 /**
  * Execute command with tester.
  *
  * @param string $command
  * @param array $args
  * @param array $options
  * @return string Display result.
  */
 protected function exec($command, $args = [], $options = [])
 {
     $this->tester->run(['command' => $command] + $args, $options);
     // Clear realpath cache.
     clearstatcache(self::$deployPath);
     return $this->tester->getDisplay();
 }
开发者ID:onedal88,项目名称:deployer,代码行数:15,代码来源:RecipeTester.php

示例2: iShouldSee

 /**
  * @Then I should see:
  */
 public function iShouldSee(PyStringNode $content)
 {
     $displayArray = explode("\n", $this->tester->getDisplay());
     array_walk($displayArray, function (&$line) {
         $line = rtrim($line);
     });
     expect($displayArray)->shouldBeLike($content->getStrings());
 }
开发者ID:phpzone,项目名称:shell,代码行数:11,代码来源:ApplicationContext.php

示例3: test_CommandSkipsExisitingUsers_IfSkipExistingOptionUsed

 public function test_CommandSkipsExisitingUsers_IfSkipExistingOptionUsed()
 {
     $this->addPreexistingSuperUser();
     $result = $this->applicationTester->run(array('command' => 'loginldap:synchronize-users', '--login' => array('ironman', 'captainamerica'), '--skip-existing' => true, '-v' => true));
     $this->assertEquals(0, $result, $this->getCommandDisplayOutputErrorMessage());
     $this->assertContains("Skipping 'captainamerica', already exists in Piwik...", $this->applicationTester->getDisplay());
     $users = $this->getLdapUserLogins();
     $this->assertEquals(array('ironman'), $users);
 }
开发者ID:heiglandreas,项目名称:plugin-LoginLdap,代码行数:9,代码来源:SynchronizeUsersTest.php

示例4: iRunCommand

 /**
  * @param string       $command
  * @param string       $file
  * @param PyStringNode $options
  *
  * @When /^I run (?P<command>[a-zA-Z0-9\.\:]*) command with file \"(?P<file>[^\"]*)\"$/
  * @When /^I run (?P<command>[a-zA-Z0-9\.\:]*) command with file \"(?P<file>[^\"]*)\" and options:$/
  */
 public function iRunCommand($command, $file = null, PyStringNode $options = null)
 {
     $arguments = array('command' => $command, 'name' => 'Test');
     $arguments['configuration-file'] = __DIR__ . "/../../" . $file;
     $options = $this->parseOptions($options);
     $arguments += $options;
     $runOptions = array('interactive' => false, 'decorated' => false);
     $this->lastExitCode = $this->tester->run($arguments, $runOptions);
     $this->lastDisplay = $this->tester->getDisplay();
 }
开发者ID:Hexmedia,项目名称:Crontab,代码行数:18,代码来源:ApplicationContext.php

示例5: testLimit

 public function testLimit()
 {
     $app = new Application();
     $app->add(new FizzBuzzCommand());
     $app->setAutoExit(false);
     // For testing
     $tester = new ApplicationTester($app);
     $tester->run(array('--limit' => '15'), array('decorated' => false));
     $this->assertContains("14", $tester->getDisplay(true));
     $this->assertContains("Fizz Buzz", $tester->getDisplay(true));
     $this->assertNotContains("16", $tester->getDisplay(true));
 }
开发者ID:hnw,项目名称:fizzbuzz,代码行数:12,代码来源:FizzBuzzTest.php

示例6: test_FixDuplicateLogActions_CorrectlyRemovesDuplicates_AndFixesReferencesInOtherTables

 public function test_FixDuplicateLogActions_CorrectlyRemovesDuplicates_AndFixesReferencesInOtherTables()
 {
     $result = $this->applicationTester->run(array('command' => 'core:fix-duplicate-log-actions', '--invalidate-archives' => 0, '-vvv' => false));
     $this->assertEquals(0, $result, "Command failed: " . $this->applicationTester->getDisplay());
     $this->assertDuplicateActionsRemovedFromLogActionTable();
     $this->assertDuplicatesFixedInLogLinkVisitActionTable();
     $this->assertDuplicatesFixedInLogConversionTable();
     $this->assertDuplicatesFixedInLogConversionItemTable();
     $this->assertContains("Found and deleted 7 duplicate action entries", $this->applicationTester->getDisplay());
     $expectedAffectedArchives = array(array('idsite' => '1', 'server_time' => '2012-01-01'), array('idsite' => '2', 'server_time' => '2013-01-01'), array('idsite' => '1', 'server_time' => '2012-02-01'), array('idsite' => '2', 'server_time' => '2012-01-09'), array('idsite' => '2', 'server_time' => '2012-03-01'));
     foreach ($expectedAffectedArchives as $archive) {
         $this->assertContains("[ idSite = {$archive['idsite']}, date = {$archive['server_time']} ]", $this->applicationTester->getDisplay());
     }
 }
开发者ID:JoeHorn,项目名称:piwik,代码行数:14,代码来源:FixDuplicateActionsTest.php

示例7: testRunWithConfigThrowExceptionIfExtensionClassDoesNotImplementsInterface

 public function testRunWithConfigThrowExceptionIfExtensionClassDoesNotImplementsInterface()
 {
     $application = new ApplicationTester($this->carew);
     $statusCode = $application->run(array('command' => 'list', '--base-dir' => __DIR__ . '/Command/fixtures/config-exception-class-not-implements'));
     $this->assertSame(1, $statusCode);
     $this->assertContains('The class "stdClass" does not implements ExtensionInterface. See "config.yml".', $application->getDisplay());
 }
开发者ID:carew,项目名称:carew,代码行数:7,代码来源:CarewTest.php

示例8: checkApplicationOutput

 private function checkApplicationOutput($output)
 {
     $expected = $this->normalize($output);
     $actual = $this->normalize($this->tester->getDisplay(true));
     if (strpos($actual, $expected) === false) {
         throw new \Exception(sprintf("Application output did not contain expected '%s'. Actual output:\n'%s'", $expected, $this->tester->getDisplay()));
     }
 }
开发者ID:phpspec,项目名称:phpspec,代码行数:8,代码来源:ApplicationContext.php

示例9: testRun

 public function testRun()
 {
     $application = new Application();
     $application->setAutoExit(false);
     $applicationTester = new ApplicationTester($application);
     $applicationTester->run([]);
     $this->assertContains('WebHelper version 0.2', $applicationTester->getDisplay([]));
 }
开发者ID:jamesrezo,项目名称:webhelper,代码行数:8,代码来源:ApplicationTest.php

示例10: testExecute

 public function testExecute()
 {
     $application = new Stratum();
     $application->setAutoExit(false);
     $tester = new ApplicationTester($application);
     $tester->run(['config file' => 'test/MySql/etc/stratum.cfg']);
     $this->assertSame(0, $tester->getStatusCode(), $tester->getDisplay());
 }
开发者ID:setbased,项目名称:php-stratum,代码行数:8,代码来源:StratumApplicationTest.php

示例11: testLoadedCommandRuns

 public function testLoadedCommandRuns()
 {
     $this->markTestSkipped('The ' . __CLASS__ . ' Symfony ... Console App ... so difficult to extend and test :[');
     $consoleApp = new Console();
     $consoleApp->setAutoExit(false);
     $tester = new ApplicationTester($consoleApp);
     $tester->run(array('command' => 'test:command', 'name' => 'Skip', '--skip-app-path' => './tests/fixtures/app'));
     $this->assertContains('Nice name you got there, Skip.', $tester->getDisplay());
 }
开发者ID:renegare,项目名称:skip_php_framework,代码行数:9,代码来源:ConsoleTest.php

示例12: testDebugOutput

 /**
  * Confirm that all the core commands with bootstrap level
  * `BOOT_SUGAR_ROOT` will be available by default.
  */
 public function testDebugOutput()
 {
     $kernel = $this->getKernel(Kernel::BOOT_INSULIN, null, true);
     $insulin = new Application($kernel);
     $insulin->setAutoExit(false);
     $insulinTester = new ApplicationTester($insulin);
     $insulinTester->run(array('command' => 'list'));
     $this->assertRegExp('/Memory usage: (.*)MB \\(peak: (.*)MB\\), time: (.*)s/', $insulinTester->getDisplay());
 }
开发者ID:insulin,项目名称:cli,代码行数:13,代码来源:ApplicationTest.php

示例13: testInvalidConnectionCausesError

 public function testInvalidConnectionCausesError()
 {
     $kernel = $this->createKernel('badconn.yml');
     $console = new Application($kernel);
     $console->setAutoExit(false);
     $tester = new ApplicationTester($console);
     $this->assertGreaterThan(0, $tester->run(['pheanstalk:stats', 'tube' => ['default']]));
     $this->assertContains('Pheanstalk\\Exception', $tester->getDisplay());
 }
开发者ID:Blackburn29,项目名称:PheanstalkBundle,代码行数:9,代码来源:StatsCommandTest.php

示例14: testAddsCommands

 /**
  * @covers ImboCli\Application::__construct
  */
 public function testAddsCommands()
 {
     $application = new Application();
     $application->setAutoExit(false);
     $applicationTester = new ApplicationTester($application);
     $applicationTester->run(array('command' => 'list'));
     $output = $applicationTester->getDisplay();
     $this->assertContains('generate-private-key', $output);
 }
开发者ID:ASP96,项目名称:imbo,代码行数:12,代码来源:ApplicationTest.php

示例15: testTestBeforeAndAfterAncestryCommand

 public function testTestBeforeAndAfterAncestryCommand()
 {
     $application = new Application($this->container);
     $application->setAutoExit(false);
     $applicationTester = new ApplicationTester($application);
     $applicationTester->run(array("command" => "testAncestry1", "--verbose" => 3));
     $output = $applicationTester->getDisplay();
     $this->assertRegExp("/Skip a before task testAncestry1 to prevent infinite loop. Because of existing it in ancestry tasks./", $output);
     //        echo $output;
 }
开发者ID:kohkimakimoto,项目名称:altax,代码行数:10,代码来源:ApplicationTest.php


注:本文中的Symfony\Component\Console\Tester\ApplicationTester::getDisplay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。