當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configuration::dataDir方法代碼示例

本文整理匯總了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;
 }
開發者ID:itillawarra,項目名稱:cmfive,代碼行數:7,代碼來源:TestCaseTest.php

示例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);
     }
 }
開發者ID:BatVane,項目名稱:Codeception,代碼行數:27,代碼來源:GenerateScenarios.php

示例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();
 }
開發者ID:itillawarra,項目名稱:cmfive,代碼行數:8,代碼來源:SqliteTest.php

示例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);
 }
開發者ID:hendryguna,項目名稱:laravel-basic,代碼行數:8,代碼來源:DbTest.php

示例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/';
     }
 }
開發者ID:MTon,項目名稱:codeception-module-visualception,代碼行數:13,代碼來源:FileStorage.php

示例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'));
 }
開發者ID:pfz,項目名稱:codeception,代碼行數:9,代碼來源:RestTest.php

示例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());
 }
開發者ID:lenninsanchez,項目名稱:donadores,代碼行數:16,代碼來源:SuiteManagerTest.php

示例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');
 }
開發者ID:foxman209,項目名稱:Codeception,代碼行數:9,代碼來源:SoapTest.php

示例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());
 }
開發者ID:kansey,項目名稱:yii2albom,代碼行數:16,代碼來源:SuiteManagerTest.php

示例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'));
 }
開發者ID:BatVane,項目名稱:Codeception,代碼行數:9,代碼來源:CestTest.php

示例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';
 }
開發者ID:pfz,項目名稱:codeception,代碼行數:10,代碼來源:c3Test.php

示例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);
 }
開發者ID:BatVane,項目名稱:Codeception,代碼行數:10,代碼來源:UnitTest.php

示例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']);
 }
開發者ID:kansey,項目名稱:yii2albom,代碼行數:11,代碼來源:RestTest.php

示例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) {
     }
 }
開發者ID:corcre,項目名稱:elabftw,代碼行數:11,代碼來源:SqliteTest.php

示例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);
 }
開發者ID:hitechdk,項目名稱:Codeception,代碼行數:12,代碼來源:DbTest.php


注:本文中的Codeception\Configuration::dataDir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。