当前位置: 首页>>代码示例>>PHP>>正文


PHP codecept_root_dir函数代码示例

本文整理汇总了PHP中codecept_root_dir函数的典型用法代码示例。如果您正苦于以下问题:PHP codecept_root_dir函数的具体用法?PHP codecept_root_dir怎么用?PHP codecept_root_dir使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了codecept_root_dir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doRequest

 /**
  * @param Request $request
  *
  * @return Response
  * @throws \Exception
  */
 public function doRequest($request)
 {
     $inputStream = fopen('php://memory', 'r+');
     $content = $request->getContent();
     if ($content !== null) {
         fwrite($inputStream, $content);
         rewind($inputStream);
     }
     $queryParams = [];
     $postParams = [];
     $queryString = parse_url($request->getUri(), PHP_URL_QUERY);
     if ($queryString != '') {
         parse_str($queryString, $queryParams);
     }
     if ($request->getMethod() !== 'GET') {
         $postParams = $request->getParameters();
     }
     $serverParams = $request->getServer();
     if (!isset($serverParams['SCRIPT_NAME'])) {
         //required by WhoopsErrorHandler
         $serverParams['SCRIPT_NAME'] = 'Codeception';
     }
     $zendRequest = new ServerRequest($serverParams, $this->convertFiles($request->getFiles()), $request->getUri(), $request->getMethod(), $inputStream, $this->extractHeaders($request));
     $zendRequest = $zendRequest->withCookieParams($request->getCookies())->withQueryParams($queryParams)->withParsedBody($postParams);
     $cwd = getcwd();
     chdir(codecept_root_dir());
     $this->application->run($zendRequest);
     chdir($cwd);
     $this->request = $zendRequest;
     $response = $this->responseCollector->getResponse();
     $this->responseCollector->clearResponse();
     return new Response($response->getBody(), $response->getStatusCode(), $response->getHeaders());
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:39,代码来源:ZendExpressive.php

示例2: makeTestCase

 protected function makeTestCase($file, $name = '')
 {
     return Stub::make('\Codeception\Lib\DescriptiveTestCase', [
             'getReportFields' => ['file' => codecept_root_dir() . $file],
             'getName' => $name]
     );
 }
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:7,代码来源:GroupManagerTest.php

示例3: testShortcutFilter

 public function testShortcutFilter()
 {
     $config = ['coverage' => ['include' => ['tests/*'], 'exclude' => ['tests/unit/CodeGuy.php']]];
     $this->filter->whiteList($config);
     $fileFilter = $this->filter->getFilter();
     $this->assertFalse($fileFilter->isFiltered(codecept_root_dir('tests/unit/c3Test.php')));
     $this->assertTrue($fileFilter->isFiltered(codecept_root_dir('tests/unit/CodeGuy.php')));
 }
开发者ID:hitechdk,项目名称:Codeception,代码行数:8,代码来源:FilterTest.php

示例4: getDrupalRoot

 /**
  * Get the Drupal root directory.
  *
  * @return string
  *   The root directory of the Drupal installation.
  */
 private function getDrupalRoot()
 {
     // We can't get getcwd() as a default parameter, so this will have to do.
     if (is_null($this->config['drupalRoot'])) {
         return codecept_root_dir();
     } else {
         // If a user has passed in a path to their Drupal root, then we'll still need to append the current working
         // directory to it.
         return codecept_root_dir($this->config['drupalRoot']);
     }
 }
开发者ID:chapabu,项目名称:codeception-drupal-runserver,代码行数:17,代码来源:DrushRunserver.php

示例5: testOneFileWithHtml

 public function testOneFileWithHtml()
 {
     $this->config['path'] = 'tests/data/claypit/tests/skipped/';
     $this->config['class_name'] = 'SkipGuy';
     $this->execute(array('suite' => 'skipped', '--single-file' => true, '--format' => 'html'));
     $this->assertEquals(codecept_root_dir() . 'tests/data/scenarios/skipped.html', $this->filename);
     $this->assertContains('<h3>I WANT TO MAKE IT INCOMPLETE</h3>', $this->content);
     $this->assertContains('<h3>I WANT TO SKIP IT</h3>', $this->content);
     $this->assertContains('<body><h3>', $this->content);
     $this->assertContains('</body></html>', $this->content);
     $this->assertContains('* Skip_Me rendered', $this->output);
     $this->assertContains('* Incomplete_Me rendered', $this->output);
 }
开发者ID:corcre,项目名称:elabftw,代码行数:13,代码来源:GenerateScenarioTest.php

示例6: getDrupalRoot

 /**
  * Get the Drupal root directory.
  *
  * @return string
  *   The root directory of the Drupal installation.
  */
 public function getDrupalRoot()
 {
     // We can't get getcwd() as a default parameter, so this will have to do.
     if (is_null($this->config['root'])) {
         return codecept_root_dir();
     }
     // Allow a user to pass an relative or an absolute path.
     if (is_null($this->config['relative']) || $this->config['relative'] !== 'yes') {
         return $this->config['root'];
     } else {
         return codecept_root_dir($this->config['root']);
     }
 }
开发者ID:chapabu,项目名称:codeception-module-drupal,代码行数:19,代码来源:DrupalBaseModule.php

示例7: _afterSuite

 /**
  * Called after suite.
  *
  * Fail the suite and output changes, if any differences was detected.
  */
 public function _afterSuite()
 {
     // Filter out files that's disappeared. This allows for processing
     // the files before we've finished the test run.
     $changes = array_filter($this->changes, function ($file) {
         return file_exists($file . self::NEWSUFFIX);
     });
     if (!empty($changes)) {
         $fileLines = array_map(function ($file) {
             $short_name = preg_replace('/^' . preg_quote(codecept_root_dir(), '/') . '/', '', $file);
             if (file_exists($file . self::SUFFIX)) {
                 return "Changed: " . $short_name . self::NEWSUFFIX;
             }
             return "New: " . $short_name . self::NEWSUFFIX;
         }, $changes);
         $message = "Visual changes detected:\n";
         $message .= implode("\n", $fileLines);
         $this->fail($message);
     }
 }
开发者ID:xendk,项目名称:argus,代码行数:25,代码来源:Argus.php

示例8: _before

 protected function _before()
 {
     $this->tarotDeck = new TarotDeck('custom', [codecept_root_dir() . 'resources/']);
     $this->tarotDraw = new TarotDraw($this->tarotDeck);
 }
开发者ID:destinylab,项目名称:tarot,代码行数:5,代码来源:TarotDrawTest.php

示例9: codecept_root_dir

<?php

/**
 * @file Global bootstrap for all codeception tests
 */
Codeception\Util\Autoload::addNamespace('Tribe__Events__WP_UnitTestCase', __DIR__ . '/_support');
Codeception\Util\Autoload::addNamespace('Tribe\\Events\\Test', __DIR__ . '/_support');
require_once codecept_root_dir('tribe-autoload.php');
开发者ID:Sophist-UK,项目名称:tribe-common,代码行数:8,代码来源:_bootstrap.php

示例10: getRootFolder

 /**
  * @return string
  */
 protected function getRootFolder()
 {
     return isset($this->config['rootFolder']) ? $this->config['rootFolder'] : rtrim(codecept_root_dir(), DIRECTORY_SEPARATOR);
 }
开发者ID:lucatume,项目名称:wp-browser,代码行数:7,代码来源:Symlinker.php

示例11: _initialize

 public function _initialize()
 {
     if (!is_file(codecept_root_dir() . $this->config['configFile'])) {
         throw new ModuleConfigException(__CLASS__, "The application config file does not exist: " . codecept_root_dir() . $this->config['configFile']);
     }
     $this->defineConstants();
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:7,代码来源:Yii2.php

示例12: getLocalConfigFilePath

 public function getLocalConfigFilePath()
 {
     return codecept_root_dir('commands-config.yml');
 }
开发者ID:lucatume,项目名称:codeception-setup-local,代码行数:4,代码来源:BaseCommand.php

示例13: codecept_relative_path

function codecept_relative_path($path)
{
    return substr($path, strlen(codecept_root_dir()));
}
开发者ID:codeception,项目名称:base,代码行数:4,代码来源:autoload.php

示例14: _beforeSuite

 public function _beforeSuite($settings = [])
 {
     $store = null;
     if ($this->ormModule instanceof DataMapper) {
         // for Doctrine
         $store = new RepositoryStore($this->ormModule->_getEntityManager());
     }
     $this->factoryMuffin = new FactoryMuffin($store);
     if ($this->config['factories']) {
         foreach ((array) $this->config['factories'] as $factoryPath) {
             $realpath = realpath(codecept_root_dir() . $factoryPath);
             if ($realpath === false) {
                 throw new ModuleException($this, 'The path to one of your factories is not correct. Please specify the directory relative to the codeception.yml file (ie. _support/factories).');
             }
             $this->factoryMuffin->loadFactories($realpath);
         }
     }
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:18,代码来源:DataFactory.php

示例15: getSetupFilePath

 /**
  * @param InputInterface $input
  * @return mixed|string
  */
 protected function getSetupFilePath(InputInterface $input)
 {
     $destination = $input->getOption('destination');
     $file = $destination ? $destination : codecept_root_dir('setup.yml');
     return $file;
 }
开发者ID:lucatume,项目名称:codeception-setup-local,代码行数:10,代码来源:SetupScaffold.php


注:本文中的codecept_root_dir函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。