Esempio n. 1
0
    public function testRecursiveStandalone()
    {
        $validator = new Validator\InArray(
            array(
                'firstDimension' => array('test', 0, 'A'),
                'secondDimension' => array('value', 2, 'a')
            )
        );
        $this->assertFalse($validator->isValid('A'));

        $validator->setRecursive(true);
        $this->assertTrue($validator->isValid('A'));
    }
Esempio n. 2
0
 public function testRecursiveDetection()
 {
     $validator = new InArray(array('haystack' => array('firstDimension' => array('test', 0, 'A'), 'secondDimension' => array('value', 2, 'a')), 'recursive' => false));
     $this->assertFalse($validator->isValid('A'));
     $validator->setRecursive(true);
     $this->assertTrue($validator->isValid('A'));
 }