本文整理汇总了PHP中Codeception\Configuration::dataDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::dataDir方法的具体用法?PHP Configuration::dataDir怎么用?PHP Configuration::dataDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Codeception\Configuration
的用法示例。
在下文中一共展示了Configuration::dataDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
$this->dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher();
$this->testcase = new \Codeception\TestCase\Cept();
$this->testcase->configDispatcher($this->dispatcher)->configName('mocked test')->configFile(\Codeception\Configuration::dataDir() . 'SimpleCept.php')->initConfig();
\Codeception\SuiteManager::$modules['EmulateModuleHelper']->assertions = 0;
}
示例2: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$suite = $input->getArgument('suite');
$config = \Codeception\Configuration::config();
$suiteconf = \Codeception\Configuration::suiteSettings($suite, $config);
@mkdir($path = \Codeception\Configuration::dataDir() . 'scenarios');
@mkdir($path = $path . DIRECTORY_SEPARATOR . $suite);
$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
$suiteManager = new \Codeception\SuiteManager($dispatcher, $suite, $suiteconf);
if (isset($suiteconf['bootstrap'])) {
if (file_exists($suiteconf['path'] . $suiteconf['bootstrap'])) {
require_once $suiteconf['path'] . $suiteconf['bootstrap'];
}
}
$suiteManager->loadTests();
$tests = $suiteManager->getSuite()->tests();
foreach ($tests as $test) {
if (!$test instanceof \Codeception\TestCase\Cept) {
continue;
}
$test->loadScenario();
$features = $test->getScenarioText();
$name = $this->underscore(substr($test->getFileName(), 0, -8));
$output->writeln("* {$name} generated");
file_put_contents($path . DIRECTORY_SEPARATOR . $name . '.txt', $features);
}
}
示例3: setUp
public function setUp()
{
$sql = file_get_contents(\Codeception\Configuration::dataDir() . '/dumps/sqlite.sql');
$sql = preg_replace('%/\\*(?:(?!\\*/).)*\\*/%s', "", $sql);
$this->sql = explode("\n", $sql);
$this->sqlite = Db::create($this->config['dsn'], $this->config['user'], $this->config['password']);
$this->sqlite->cleanup();
}
示例4: loadDump
protected function loadDump()
{
$sql = file_get_contents(\Codeception\Configuration::dataDir() . '/dumps/sqlite.sql');
$sql = preg_replace('%/\*(?:(?!\*/).)*\*/%s', "", $sql);
$sql = explode("\n", $sql);
$sqlite = \Codeception\Util\Driver\Db::create($this->config['dsn'], $this->config['user'], $this->config['password']);
$sqlite->load($sql);
}
示例5: __construct
/**
* Constructor is setting up the path for the images
*
* @param array $config
*/
public function __construct(array $config)
{
if (array_key_exists('expectedImageDir', $config)) {
$this->storageDir = $config["expectedImageDir"];
} else {
$this->storageDir = \Codeception\Configuration::dataDir() . 'VisualCeption/expected/';
}
}
示例6: setUp
public function setUp()
{
$this->module = new \Codeception\Module\REST();
$connector = new \Codeception\Util\Connector\Universal();
$connector->setIndex(\Codeception\Configuration::dataDir() . '/rest/index.php');
$this->module->client = $connector;
$this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
$this->module->client->setServerParameters(array('SCRIPT_FILENAME' => 'index.php', 'SCRIPT_NAME' => 'index', 'SERVER_NAME' => 'localhost', 'SERVER_PROTOCOL' => 'http'));
}
示例7: testAddCestWithEnv
/**
* When running multiple environments, getClassesFromFile() method in SuiteManager is called once for each env.
* See \Codeception\Codecept::runSuite() - for each env new SuiteManager is created and tests loaded.
* Make sure that calling getClassesFromFile() multiple times will always return the same classes.
*
* @group core
*/
public function testAddCestWithEnv()
{
$file = \Codeception\Configuration::dataDir() . 'SimpleCestWithNamespace.php';
$this->suiteman->addCest($file);
$this->assertEquals(3, $this->suiteman->getSuite()->count());
$newSuiteMan = Stub::make('\\Codeception\\SuiteManager', array('dispatcher' => $this->dispatcher, 'suite' => new PHPUnit_Framework_TestSuite(), 'settings' => array('bootstrap' => false, 'class_name' => 'CodeGuy', 'namespace' => '')));
$newSuiteMan->addCest($file);
$this->assertEquals(3, $newSuiteMan->getSuite()->count());
}
示例8: setUp
public function setUp()
{
$this->module = new \Codeception\Module\SOAP(make_container());
$this->module->_setConfig(array('schema' => 'http://www.w3.org/2001/xml.xsd', 'endpoint' => 'http://codeception.com/api/wsdl'));
$this->layout = \Codeception\Configuration::dataDir() . '/xml/layout.xml';
$this->module->isFunctional = true;
$this->module->_before(Stub::makeEmpty('\\Codeception\\Test\\Test'));
$this->module->client = Stub::makeEmpty('\\Codeception\\Lib\\Connector\\Universal');
}
示例9: testAddCestWithEnv
/**
* When running multiple environments, getClassesFromFile() method in SuiteManager is called once for each env.
* See \Codeception\Codecept::runSuite() - for each env new SuiteManager is created and tests loaded.
* Make sure that calling getClassesFromFile() multiple times will always return the same classes.
*
* @group core
*/
public function testAddCestWithEnv()
{
$file = \Codeception\Configuration::dataDir() . 'SimpleNamespacedTest.php';
$this->suiteman->loadTests($file);
$this->assertEquals(3, $this->suiteman->getSuite()->count());
$newSuiteMan = new \Codeception\SuiteManager($this->dispatcher, 'suite', \Codeception\Configuration::$defaultSuiteSettings);
$newSuiteMan->loadTests($file);
$this->assertEquals(3, $newSuiteMan->getSuite()->count());
}
示例10: setUp
public function setUp()
{
$this->dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher();
$conf = \Codeception\Configuration::config();
require_once \Codeception\Configuration::dataDir() . 'DummyClass.php';
$file = \Codeception\Configuration::dataDir() . 'SimpleCest.php';
require_once $file;
$this->testcase = new \Codeception\TestCase\Cest($this->dispatcher, array('name' => '', 'file' => $file, 'class' => new SimpleCest(), 'method' => 'helloWorld', 'static' => false, 'signature' => 'DummyClass.helloWorld'));
}
示例11: setUp
protected function setUp()
{
if (!extension_loaded('xdebug')) {
$this->markTestSkipped('xdebug extension required for c3test.');
}
$this->c3 = Configuration::dataDir() . 'claypit/c3.php';
$this->c3_dir = Configuration::dataDir() . 'claypit/c3tmp/';
$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE'] = 'test';
$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG'] = 'debug';
}
示例12: setUp
public function setUp()
{
require_once \Codeception\Configuration::dataDir() . '/services/UserModel.php';
require_once \Codeception\Configuration::dataDir() . '/services/UserService.php';
$this->test = $this->makeTest();
$this->scenario = $this->test->getScenario();
$this->module = new \Codeception\Module\Unit();
$this->module->_initialize();
$this->module->_before($this->test);
}
示例13: setUp
public function setUp()
{
$connector = new \Codeception\Lib\Connector\Universal();
$connector->setIndex(\Codeception\Configuration::dataDir() . '/rest/index.php');
$connectionModule = new \Codeception\Module\PhpBrowser();
$connectionModule->client = $connector;
$this->module = Stub::make('\\Codeception\\Module\\REST', ['getModules' => [$connectionModule]]);
$this->module->_initialize();
$this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
$this->module->client->setServerParameters(['SCRIPT_FILENAME' => 'index.php', 'SCRIPT_NAME' => 'index', 'SERVER_NAME' => 'localhost', 'SERVER_PROTOCOL' => 'http']);
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
$sql = file_get_contents(\Codeception\Configuration::dataDir() . '/dumps/sqlite.sql');
$sql = preg_replace('%/\\*(?:(?!\\*/).)*\\*/%s', "", $sql);
self::$sql = explode("\n", $sql);
try {
self::$sqlite = Db::create(self::$config['dsn'], self::$config['user'], self::$config['password']);
self::$sqlite->cleanup();
} catch (\Exception $e) {
}
}
示例15: setUpBeforeClass
public static function setUpBeforeClass()
{
self::$module = new \Codeception\Module\Db(make_container());
self::$module->_setConfig(self::$config);
self::$module->_initialize();
$sqlite = self::$module->driver;
$sqlite->cleanup();
$sql = file_get_contents(\Codeception\Configuration::dataDir() . '/dumps/sqlite.sql');
$sql = preg_replace('%/\\*(?:(?!\\*/).)*\\*/%s', "", $sql);
$sql = explode("\n", $sql);
$sqlite->load($sql);
}