/** * Test for timesync object creation with an array of timeservers */ public function testServerCreation() { $server = new Zend_TimeSync($this->timeservers); $server->addServer($this->timeservers); $this->assertTrue($server instanceof Zend_TimeSync); try { $server->addServer(123); $this->fail('Exception expected because of invalid timeserver must be either a string or array'); } catch (Zend_TimeSync_Exception $e) { // success } }
/** * Test adding an invalid timeserver * * @return void */ public function testAddInvalidServer() { $server = new Zend_TimeSync(); try { $server->addServer(12345); $this->fail('Exception expected because we supplied an invalid timeserverserver'); } catch (Zend_TimeSync_Exception $e) { // success } }