function it_returns_the_validation_rules() { $this->getRules()->shouldReturn(['description' => 'required|string', 'type' => 'required|in:' . implode(',', Attribute::getAllowedTypes())]); }
public function __construct() { $this->rules['type'] .= '|in:' . implode(',', Attribute::getAllowedTypes()); }
function it_provides_a_list_of_possible_types() { $types = Attribute::getAllowedTypes(); \PHPUnit_Framework_Assert::assertEquals(['string', 'numeric', 'in'], $types); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { return view('attributes.create')->with('allowed_types', Attribute::getAllowedTypes()); }