/** * Testing initializing with several options */ public function testInstanceWithOldOptions() { $handler = set_error_handler(array($this, 'errorHandler'), E_USER_NOTICE); $validator = new Validator\EmailAddress(); $options = $validator->getOptions(); $this->assertEquals(Hostname::ALLOW_DNS, $options['allow']); $this->assertFalse($options['mx']); try { $validator = new Validator\EmailAddress(Hostname::ALLOW_ALL, true, new Hostname(Hostname::ALLOW_ALL)); $options = $validator->getOptions(); $this->assertEquals(Hostname::ALLOW_ALL, $options['allow']); $this->assertTrue($options['mx']); set_error_handler($handler); } catch (\Zend\Exception $e) { $this->markTestSkipped('MX not available on this system'); } }