예제 #1
0
 /**
  * Check for internet connectivity
  *
  * @return boolean Whether an internet connection is available
  */
 public static function has_internet()
 {
     if (!isset(self::$_has_internet)) {
         // The @ operator is used here to avoid DNS errors when there is no connection.
         $sock = @fsockopen("www.google.com", 80, $errno, $errstr, 1);
         self::$_has_internet = (bool) $sock ? TRUE : FALSE;
     }
     return self::$_has_internet;
 }
예제 #2
0
 /**
  * Check for internet connectivity
  *
  * @return boolean Whether an internet connection is available
  */
 public function hasInternet()
 {
     return Kohana_Unittest_Helpers::has_internet();
 }
예제 #3
0
 public function restoreEnvironment()
 {
     $this->_helpers->restore_environment();
 }
예제 #4
0
 /**
  * Allows easy setting & backing up of enviroment config
  *
  * Option types are checked in the following order:
  *
  * * Server Var
  * * Static Variable
  * * Config option
  *
  * @param array $environment List of environment to set
  */
 public function setEnvironment(array $environment)
 {
     return $this->_helpers->set_environment($environment);
 }