Пример #1
0
 /**
  * testReset method
  *
  * @return void
  */
 public function testReset()
 {
     $config = array('persistent' => true, 'host' => '127.0.0.1', 'protocol' => 'udp', 'port' => 80, 'timeout' => 20);
     $anotherSocket = new CakeSocket($config);
     $anotherSocket->reset();
     $this->assertEquals(array(), $anotherSocket->config);
 }
Пример #2
0
 /**
  * Resets the state of this HttpSocket instance to it's initial state (before Object::__construct got executed) or does
  * the same thing partially for the request and the response property only.
  *
  * @param bool $full If set to false only HttpSocket::response and HttpSocket::request are reset
  * @return bool True on success
  */
 public function reset($full = true)
 {
     static $initalState = array();
     if (empty($initalState)) {
         $initalState = get_class_vars(__CLASS__);
     }
     if (!$full) {
         $this->request = $initalState['request'];
         $this->response = $initalState['response'];
         return true;
     }
     parent::reset($initalState);
     return true;
 }