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


PHP Mockery::fillModel方法代码示例

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


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

示例1: testFillModelNullInput

 public function testFillModelNullInput()
 {
     $model = new \stdClass();
     $this->field->shouldReceive('getOption')->once()->andReturn('field')->shouldReceive('parseNumber')->never();
     $this->field->fillModel($model, null);
     $this->assertEquals($model->field, null);
 }
开发者ID:dmitriyuch,项目名称:Laravel-Administrator,代码行数:7,代码来源:NumberTest.php

示例2: testFillModelFalse

 public function testFillModelFalse()
 {
     $model = new \stdClass();
     $this->field->shouldReceive('getOption')->once()->andReturn('field');
     $this->field->fillModel($model, 'false');
     $this->assertEquals($model->field, 0);
 }
开发者ID:EmersonStone,项目名称:Laravel-Administrator,代码行数:7,代码来源:BoolTest.php

示例3: testFillModelWithoutInput

 public function testFillModelWithoutInput()
 {
     $model = new BelongsToEloquentStub();
     $model->rel = '3';
     $this->field->shouldReceive('getOption')->twice()->andReturn('rel_id', 'rel');
     $this->field->fillModel($model, 'false');
     $this->assertEquals($model->rel_id, null);
     $this->assertTrue(!isset($model->rel));
 }
开发者ID:hifone,项目名称:dashboard,代码行数:9,代码来源:BelongsToTest.php

示例4: testFillModel

 public function testFillModel()
 {
     $input = m::mock('Illuminate\\Http\\Request');
     $input->shouldReceive('get')->times(3);
     $field = m::mock('Frozennode\\Administrator\\Fields\\Field');
     $field->shouldReceive('getOption')->times(4)->andReturn(false, true, 'text', false)->shouldReceive('fillModel')->once();
     $field_external = m::mock('Frozennode\\Administrator\\Fields\\Field');
     $field_external->shouldReceive('getOption')->times(3)->andReturn(true, 'belongs_to_many', false);
     $field_uneditable = m::mock('Frozennode\\Administrator\\Fields\\Field');
     $field_uneditable->shouldReceive('getOption')->times(4)->andReturn(false, false, 'text', false);
     $field_setter = m::mock('Frozennode\\Administrator\\Fields\\Field');
     $field_setter->shouldReceive('getOption')->times(4)->andReturn(false, true, 'text', true)->shouldReceive('fillModel')->once();
     $field_password = m::mock('Frozennode\\Administrator\\Fields\\Field');
     $field_password->shouldReceive('getOption')->times(4)->andReturn(false, true, 'password', false)->shouldReceive('fillModel')->once();
     $model = m::mock('stdClass')->makePartial();
     $model->field = 'field_value';
     $model->field_external = 'field_external_value';
     $model->field_uneditable = 'field_uneditable_value';
     $model->field_setter = 'field_setter_value';
     $model->field_password = '';
     $model->shouldReceive('__unset')->times(4);
     $model->shouldReceive('getKeyName')->times(2);
     $fields = array('field_external' => $field_external, 'field_uneditable' => $field_uneditable, 'field_setter' => $field_setter, 'field_password' => $field_password, 'field' => $field);
     $this->config->fillModel($model, $input, $fields);
 }
开发者ID:seafarer-team,项目名称:Laravel-Administrator,代码行数:25,代码来源:ModelConfigTest.php

示例5: testFillModelWithoutSortField

	public function testFillModelWithoutSortField()
	{
		$model = new BelongsToManyEloquentStub;
		$this->field->shouldReceive('getOption')->twice()->andReturn('fieldNoSort', false);
		$this->field->fillModel($model, '3,4,5');
		$this->assertTrue(!isset($model->rel));
	}
开发者ID:pcerbino,项目名称:falcionevega,代码行数:7,代码来源:BelongsToManyTest.php

示例6: testFillModelBadInput

 public function testFillModelBadInput()
 {
     $model = new \stdClass();
     $this->field->shouldReceive('getOption')->never()->shouldReceive('getDateString')->never();
     $this->field->fillModel($model, null);
     $this->assertTrue(!isset($model->field));
 }
开发者ID:EmersonStone,项目名称:Laravel-Administrator,代码行数:7,代码来源:TimeTest.php

示例7: testFillModelWithZeros

 public function testFillModelWithZeros()
 {
     $model = new \stdClass();
     $this->field->shouldReceive('getOption')->never()->shouldReceive('getDateString')->never();
     $this->field->fillModel($model, '0000-00-00');
     $this->assertTrue(!isset($model->field));
 }
开发者ID:bytrix,项目名称:witkey,代码行数:7,代码来源:TimeTest.php


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