public function testConfiguration() { @unlink(dirname(__FILE__) . '/../data/configuration/config.txt'); $test = new TestConfiguration(); $test->testInstallation(); $test->testSettings(); }
public function testMerge() { $c = new TestConfiguration(['db' => ['user' => 'app', 'passwd' => 'test']]); $c->mergeWith(['db' => ['passwd' => '123', 'host' => 'local']]); $this->assertEquals('app', $c->get('db.user')); $this->assertEquals('123', $c->get('db.passwd')); $this->assertEquals('local', $c->get('db.host')); }
static function setUp() { set_include_path(implode(PATH_SEPARATOR, array(realpath(dirname(__FILE__) . '/../application'), realpath(dirname(__FILE__) . '/../library'), get_include_path()))); require_once realpath(dirname(__FILE__) . '/../application/Bootstrap.php'); require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance(); self::$bootstrap = new Bootstrap(getenv('APPLICATION_ENV')); Zend_Session::$_unitTestEnabled = true; Zend_Loader::loadClass('Sql'); $sql = new Sql(); $sql->reset(); }
public static function setUpBeforeClass() { $testConf = new TestConfiguration(); self::$textApi = new TextApi($testConf->getApiClient()); }
public function setUp() { call_user_func(array(TestConfiguration::$bootstrap, "configure")); TestConfiguration::setUpOrdinanceAndOrdinanceUsersTable(); TestConfiguration::setupUsersTables(); }
public static function setUpBeforeClass() { $testConf = new TestConfiguration(); self::$expressionsApi = new ExpressionsApi($testConf->getApiClient()); self::$jsonBulkExpression = file_get_contents('bulkInput.json'); }
* For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require_once dirname(__FILE__) . '/../../bootstrap/unit.php'; $t = new lime_test(29, new lime_output_color()); class ProjectConfiguration extends sfProjectConfiguration { } class TestConfiguration extends sfApplicationConfiguration { public function getI18NGlobalDirs() { return array(dirname(__FILE__) . '/fixtures'); } } $configuration = new TestConfiguration('test', true, sfConfig::get('sf_test_cache_dir', sfToolkit::getTmpDir())); $dispatcher = $configuration->getEventDispatcher(); $cache = new sfNoCache(); // ->initialize() $t->diag('->initialize()'); $i18n = new sfI18N($configuration, $cache); $dispatcher->notify(new sfEvent(null, 'user.change_culture', array('culture' => 'fr'))); $t->is($i18n->getCulture(), 'fr', '->initialize() connects to the user.change_culture event'); // ->getCulture() ->setCulture() $t->diag('->getCulture() ->setCulture()'); $i18n = new sfI18N($configuration, $cache); $t->is($i18n->getCulture(), 'en', '->getCulture() returns the current culture'); $i18n->setCulture('fr'); $t->is($i18n->getCulture(), 'fr', '->setCulture() sets the current culture'); // ->__() $t->diag('->__()');
public function setUp() { TestConfiguration::setupDatabase(); }
<?php require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__) . '/../library/My/Test/TestConfiguration.php'; class TestConfiguration extends My_Test_TestConfiguration { } TestConfiguration::setup();