コード例 #1
0
ファイル: AdapterTest.php プロジェクト: wriver4/activerecord
 public function setUp($connection_name = null)
 {
     if ($connection_name && !\in_array($connection_name, \PDO::getAvailableDrivers()) || Config::instance()->getConnection($connection_name) === 'skip') {
         $this->markTestSkipped($connection_name . ' drivers are not present');
     }
     parent::setUp($connection_name);
 }
コード例 #2
0
ファイル: bootstrap.php プロジェクト: wriver4/activerecord
        if ($GLOBALS['argv'][$i] == '--adapter') {
            $cfg->setDefaultConnection($GLOBALS['argv'][$i + 1]);
        } elseif ($GLOBALS['argv'][$i] == '--slow-tests') {
            $GLOBALS['slow_tests'] = true;
        }
    }
    if (\class_exists('LogFile')) {
        $logger = new LogFile(\dirname(__FILE__) . '/../log/query.log', 'ident', array('mode' => 0664, 'timeFormat' => '%Y-%m-%d %H:%M:%S'));
        $cfg->setLogging(true);
        $cfg->setLogger($logger);
    } else {
        // if ($GLOBALS['show_warnings'] && !isset($GLOBALS['show_warnings_done'])) org
        if (!isset($GLOBALS['show_warnings_done'])) {
            echo "(Logging SQL queries disabled, PEAR::Log not found.)\n";
        }
        DatabaseTest::$log = false;
    }
    // if ($GLOBALS['show_warnings'] && !isset($GLOBALS['show_warnings_done'])) org
    if (!isset($GLOBALS['show_warnings_done'])) {
        if (!\extension_loaded('memcache')) {
            echo "(Cache Tests will be skipped, Memcache not found.)\n";
        }
    }
    \date_default_timezone_set('UTC');
    $GLOBALS['show_warnings_done'] = true;
});
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
    $GLOBALS['OS'] = 'WIN';
} else {
    $GLOBALS['OS'] = 'X';
}