makePartial(); $mock->shouldReceive('getFieldInfo')->andReturn($field); $mock->shouldReceive('getEntityLanguage')->andReturn('en'); $mock->__construct($entity, $entity_type, $field); return $mock; } /** * Simulate __call() since mocked handlers will not run through magic methods. * * @param mixed $values * The field value(s). * * @return array * The values parameter cast to an array. */ protected function values($values) { return (array) $values; } }