public function testPrepareDataAndRulesNewModel() { $model = m::mock('stdClass')->makePartial(); $model->exists = false; $model->shouldReceive('getAttributes')->once()->andReturn(array('key' => 'something', 'secondkey' => 'somethingelse')); $this->config->shouldReceive('getModelValidationRules')->once()->andReturn(array('key' => 'somerule', 'other' => 'somerule')); extract($this->config->prepareDataAndRules($model)); $this->assertEquals($rules, array('key' => 'somerule', 'other' => 'somerule')); $this->assertEquals($data, array('key' => 'something', 'secondkey' => 'somethingelse')); }