public function testPassTraversableToConstructor() { $validator = new Validator\IsInstanceOf(new \ArrayIterator(array('className' => 'DateTime'))); $this->assertEquals('DateTime', $validator->getClassName()); $this->assertTrue($validator->isValid(new DateTime())); $this->assertFalse($validator->isValid(null)); $this->assertFalse($validator->isValid($this)); }
/** * Ensures that getClassName() returns expected value * * @return void */ public function testGetClassName() { $validator = new Validator\IsInstanceOf('DateTime'); $this->assertEquals('DateTime', $validator->getClassName()); }