assert() public method

public assert ( $input )
Esempio n. 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);
 }
Esempio n. 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);
 }