public function setUp() { $this->_config = ZFTestManager::getConfig('Zend_Http'); if (!isset($this->_config['remote_uri'])) { $this->markTestSkipped('[Zend_Http] remote_uri must be set for this test to run.'); } }
function setUp() { $this->_config = ZFTestManager::getConfig('Zend_Db_Adapter_Pdo'); if (!isset($this->_config['mssql_hostname']) || !isset($this->_config['mssql_username']) || !isset($this->_config['mssql_password']) || !isset($this->_config['mssql_database'])) { $this->markTestSkipped('[Zend_Cache] mssql_hostname, mssql_username, mssql_password and mssql_database must be set to run these tests.'); return; } parent::setUp(); }
public function setUp() { $this->_config = ZFTestManager::getConfig('Zend_Cache'); if (!extension_loaded('memcache')) { $this->markTestSkipped('APC extension is needed to run this test.'); return; } if (!isset($this->_config['memcache_host']) || !isset($this->_config['memcache_port']) || !isset($this->_config['memcache_persistent'])) { $this->markTestSkipped('[Zend_Cache] memcache_host, memcache_port, and memcache_persistent must be set to run these tests.'); return; } $server = array('host' => $this->_config['memcache_host'], 'port' => $this->_config['memcache_port'], 'persistent' => $this->_config['memcache_persistent']); $options = array('servers' => array(0 => $server)); $this->_instance = new Zend_Cache_Backend_Memcached($options); parent::setUp(); }
protected static function _suite($alltests_class, $alltests_file, $sub_suite = null) { $suite_name = basename($alltests_class, "_AllTests"); $readable_name = str_replace("_", " ", $suite_name); $suite = new PHPUnit_Framework_TestSuite($readable_name); $tests = self::_getTests(dirname($alltests_file)); // trickery to get around the statics problem in php eval("\$disabled = " . $alltests_class . "::\$disabled;"); eval("\$requires_config = " . $alltests_class . "::\$requires_config;"); foreach ($tests as $test => $filename) { $test_file_path = dirname($alltests_file) . DIRECTORY_SEPARATOR . $filename; $test_class_name = $suite_name . "_" . $test; $test_class_config = ZFTestManager::getConfig($test_class_name); if (!is_null($sub_suite) && strpos($test, $sub_suite) === false) { continue; } // if test is disabled by default, and not turned on, continue if (in_array($test_class_name, $disabled) && $test_class_config['enabled'] != true) { continue; } // if test is not disabled by default, but is disabled in config, continue if (!in_array($test_class_name, $disabled) && $test_class_config['disabled'] == true) { continue; } if (in_array($test_class_name, $requires_config) && $test_class_config === null) { echo "Class {$test_class_name} is enabled, but requires config options to be set in TestConfiguration.ini.\n"; echo "See {$test_file_path} for more details.\n"; exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); } PHPUnit_Util_Fileloader::checkAndLoad($test_file_path); try { $suite->addTestSuite($test_class_name); } catch (InvalidArgumentException $e) { echo "File for {$test_class_name} was loaded, but a class named {$test_class_name} was not found.\n"; exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); } //$suite->addTestFile($test_file_path); } return $suite; }