Author: Henrique Moody (henriquemoody@gmail.com)
Inheritance: extends Respect\Validation\Rules\AllOf
Example #1
0
 /**
  * @expectedException Respect\Validation\Exceptions\KeySetException
  * @expectedExceptionMessage Must have keys { "name" }
  * @dataProvider providerForInvalidArguments
  */
 public function testShouldThrowExceptionInCaseArgumentIsAnythingOtherThanArray($input)
 {
     $keySet = new KeySet(new Key('name'));
     $keySet->assert($input);
 }
Example #2
0
 /**
  * @expectedException Respect\Validation\Exceptions\KeySetException
  * @expectedExceptionMessage Must have keys "foo","bar"
  */
 public function testShouldAssertKeys()
 {
     $input = array();
     $key1 = new Key('foo', new AlwaysValid(), true);
     $key2 = new Key('bar', new AlwaysValid(), true);
     $keySet = new KeySet($key1, $key2);
     $keySet->assert($input);
 }