本文整理汇总了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);
}
示例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']);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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']);
}