Example #1
0
 public function testOverrideAttributesParameter()
 {
     $this->config->shouldReceive('get')->once()->with('fakefactory::generate_id')->andReturn(false);
     $query = new Query($this->factory, $this->config);
     $makeClass = 'foo';
     $buildOptions = array('generate_id' => false, 'override_attributes' => array('foo' => 'bar', 'bar' => 'baz'), 'with' => array(), 'exclude_attributes' => array(), 'override_rules' => array(), 'skip_related_models' => false);
     $this->factory->shouldReceive('setBuildOptions')->once()->with($buildOptions);
     $this->factory->shouldReceive('make')->once();
     $query->overrideAttributes(array('foo' => 'bar'))->make($makeClass, array('bar' => 'baz'));
 }