/** * @expectedException InvalidArgumentException */ public function testValidateFails() { $this->field->shouldReceive('getRules')->once()->andReturn(array()); $this->validator->shouldReceive('override')->once()->shouldReceive('fails')->once()->andReturn(true)->shouldReceive('messages')->once()->andReturn(m::mock(array('all' => array()))); $this->config->shouldReceive('getOption')->once()->andReturn(''); $this->field->validateOptions(); }
/** * @expectedException InvalidArgumentException */ public function testValidateOptionsStringNameNonStringOptions() { $name = 'field'; $options = true; $this->config->shouldReceive('getOption')->once()->andReturn(''); $this->factory->validateOptions($name, $options); }