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


PHP PHPUnit_Framework_MockObject_MockObject::runCommand方法代码示例

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


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

示例1: testClean

 /**
  * Test clean command
  *
  * @return void
  */
 public function testClean()
 {
     $this->Shell->runCommand(['router']);
     $output = $this->out->output();
     $this->assertTextContains('Router::url(\'/\')', $output);
     $this->assertTextContains('/test', $output);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:12,代码来源:TestCliShellTest.php

示例2: _testUserInteractive

 /**
  * UserShellTest::testUserInteractive()
  *
  * @return void
  */
 public function _testUserInteractive()
 {
     $this->Shell->expects($this->at(0))->method('in')->will($this->returnValue('example'));
     $this->Shell->expects($this->at(1))->method('in')->will($this->returnValue('123'));
     $this->Shell->expects($this->at(3))->method('in')->will($this->returnValue('example@example.de'));
     $this->Shell->runCommand(['create']);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:12,代码来源:UserShellTest.php

示例3: testPwdQuick

 /**
  * ResetShellTest::testPwd()
  *
  * @return void
  */
 public function testPwdQuick()
 {
     $this->Shell->runCommand(['pwd', '123']);
     $output = $this->out->output();
     $expected = '1 pwds resetted';
     $this->assertTextContains($expected, (string) $output);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:12,代码来源:ResetShellTest.php

示例4: testClear

 /**
  * @return void
  */
 public function testClear()
 {
     $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
     $this->Shell->runCommand(['clear']);
     $output = $this->out->output();
     $expected = 'Done!';
     $this->assertContains($expected, $output);
 }
开发者ID:dereuromark,项目名称:cakephp-cache,代码行数:11,代码来源:CacheShellTest.php

示例5: testFolderAgainWithHalf

 /**
  * Test clean command
  *
  * @return void
  */
 public function testFolderAgainWithHalf()
 {
     $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
     $this->Shell->runCommand(['folder', TMP . 'indent' . DS, '-a']);
     $output = $this->out->output();
     $this->assertContains('found: 1', $output);
     $result = file_get_contents(TMP . 'indent' . DS . 'indent.php');
     $expected = file_get_contents($this->testFilePath . 'indent_again.php');
     $this->assertTextEquals($expected, $result);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:15,代码来源:IndentShellTest.php

示例6: testClearLogs

 /**
  * Test clean command
  *
  * @return void
  */
 public function testClearLogs()
 {
     if (!is_dir(LOGS)) {
         mkdir(LOGS, 0775, true);
     }
     $file = LOGS . 'fooo.log';
     file_put_contents($file, 'Bla');
     $this->assertTrue(file_exists($file));
     $this->Shell->runCommand(['logs', '-v']);
     $output = $this->out->output();
     $this->assertContains('logs' . DS . 'fooo.log', $output);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:17,代码来源:ClearShellTest.php

示例7: testEof

 /**
  * WhitespaceShellTest::testEof()
  *
  * @return void
  */
 public function testEof()
 {
     $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
     $content = PHP_EOL . ' <?php echo $foo;' . PHP_EOL . '?> ' . PHP_EOL . PHP_EOL;
     file_put_contents(TMP . 'whitespace' . DS . 'Foo.php', $content);
     $this->Shell->runCommand(['eof', TMP . 'whitespace' . DS]);
     $output = $this->out->output();
     //debug($output);die();
     $output = file_get_contents(TMP . 'whitespace' . DS . 'Foo.php');
     $expected = '<?php echo $foo;' . PHP_EOL;
     unlink(TMP . 'whitespace' . DS . 'Foo.php');
     $this->assertEquals($expected, $output);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:18,代码来源:WhitespaceShellTest.php

示例8: testTestEntryCustom

 /**
  * @return void
  */
 public function testTestEntryCustom()
 {
     $this->Logs = TableRegistry::get('DatabaseLog.DatabaseLogs');
     $this->Shell->runCommand(['test_entry', 'warning', 'My warning']);
     $log = $this->Logs->find()->order(['id' => 'DESC'])->first();
     $this->assertSame('warning', $log->type);
     $this->assertSame('My warning', $log->message);
 }
开发者ID:dereuromark,项目名称:cakephp-databaselog,代码行数:11,代码来源:DatabaseLogShellTest.php

示例9: testTablePrefixAdd

 /**
  * @expectedException \Cake\Console\Exception\StopException
  * @return void
  */
 public function testTablePrefixAdd()
 {
     $config = ConnectionManager::config('test');
     if (strpos($config['driver'], 'Mysql') === false) {
         $this->skipIf(true, 'Only for MySQL (with MyISAM/InnoDB)');
     }
     $this->Shell->expects($this->any())->method('in')->will($this->returnValue('Y'));
     //$this->expectException(StopException::class);
     //$this->expectExceptionMessage('Nothing to do...');
     $this->Shell->runCommand(['table_prefix', 'A', 'foo_', '-d', '-v']);
 }
开发者ID:dereuromark,项目名称:cakephp-setup,代码行数:15,代码来源:DbMaintenanceShellTest.php


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