当前位置: 首页>>代码示例>>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;未经允许,请勿转载。