本文整理汇总了PHP中Shell::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Shell::expects方法的具体用法?PHP Shell::expects怎么用?PHP Shell::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell::expects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTruncateModels
/**
* Tests the truncateModels function
*
* @return void
* @covers ::truncateModels
*/
public function testTruncateModels()
{
$this->_shell->expects($this->at(0))->method('out')->with($this->equalTo('Truncate model Apple...'));
$this->_shell->expects($this->at(1))->method('out')->with($this->equalTo('Truncate model Banana...'));
$this->_shell->expects($this->at(2))->method('out')->with($this->equalTo('Truncate model Pear...'));
$models = array('Apple', 'Banana', 'Pear');
$this->_truncator->truncateModels($models);
}
示例2: testSaveSeedsNotSaved
/**
* Tests the saveSeeds method when saving fails
*
* @return void
* @covers ::saveSeeds
*/
public function testSaveSeedsNotSaved()
{
$this->_createProcessorMock(array('_getModel'));
$seeds = array('seeds');
$model = $this->getMock('Apple', array('saveAll'));
$options = array('validate' => 'first');
$model->validationErrors = 'test123';
$this->_seeder->expects($this->at(0))->method('getValidateSeeding')->will($this->returnValue('first'));
$this->_processor->expects($this->at(0))->method('_getModel')->will($this->returnValue($model));
$model->expects($this->at(0))->method('saveAll')->with($this->equalTo($seeds), $this->equalTo($options))->will($this->returnValue(false));
$this->_seeder->expects($this->at(1))->method('out')->with($this->equalTo('Seeds could not be saved successfully!'));
$this->_seeder->expects($this->at(2))->method('out')->with($this->equalTo("Data validation errors: 'test123'"));
$this->_processor->saveSeeds($seeds);
}