@@ 45-56 (lines=12) @@ | ||
42 | * |
|
43 | * @throws \Graze\ConfigValidation\Exceptions\ConfigValidationFailedException |
|
44 | */ |
|
45 | public function testSimpleValidation(array $input, array $expected) |
|
46 | { |
|
47 | $validator = (new ArrayValidator()) |
|
48 | ->optional('defaults.path', v::stringType(), '/some/path') |
|
49 | ->optional('defaults.group', v::stringType(), 'group') |
|
50 | ->required('must', v::stringType()->equals('be here')); |
|
51 | ||
52 | $this->assertTrue($validator->isValid($input)); |
|
53 | $actual = $validator->validate($input); |
|
54 | ||
55 | $this->assertEquals($expected, $actual); |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return array |
@@ 45-56 (lines=12) @@ | ||
42 | * |
|
43 | * @throws \Graze\ConfigValidation\Exceptions\ConfigValidationFailedException |
|
44 | */ |
|
45 | public function testSimpleValidation($input, $expected) |
|
46 | { |
|
47 | $validator = (new ObjectValidator()) |
|
48 | ->optional('defaults->path', v::stringType(), '/some/path') |
|
49 | ->optional('defaults->group', v::stringType(), 'group') |
|
50 | ->required('must', v::stringType()->equals('be here')); |
|
51 | ||
52 | $this->assertTrue($validator->isValid($input)); |
|
53 | $actual = $validator->validate($input); |
|
54 | ||
55 | $this->assertEquals($expected, $actual); |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return array |