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


PHP Shell::expects方法代码示例

本文整理汇总了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);
 }
开发者ID:ravage84,项目名称:cakephp-fake-seeder,代码行数:14,代码来源:ShellModelTruncatorTest.php

示例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);
 }
开发者ID:ravage84,项目名称:cakephp-fake-seeder,代码行数:20,代码来源:ShellSeedProcessorTest.php


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