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


PHP Debug::debug方法代码示例

本文整理汇总了PHP中Codeception\Util\Debug::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::debug方法的具体用法?PHP Debug::debug怎么用?PHP Debug::debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Codeception\Util\Debug的用法示例。


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

示例1: doRequest

 /**
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  *
  * @return \Symfony\Component\BrowserKit\Response
  */
 public function doRequest($request)
 {
     $_COOKIE = $request->getCookies();
     $_SERVER = $request->getServer();
     $_FILES = $request->getFiles();
     $_REQUEST = $request->getParameters();
     $_POST = $_GET = array();
     if (strtoupper($request->getMethod()) == 'GET') {
         $_GET = $request->getParameters();
     } else {
         $_POST = $request->getParameters();
     }
     $uri = $request->getUri();
     $pathString = parse_url($uri, PHP_URL_PATH);
     $queryString = parse_url($uri, PHP_URL_QUERY);
     $_SERVER['REQUEST_URI'] = $queryString === null ? $pathString : $pathString . '?' . $queryString;
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     parse_str($queryString, $params);
     foreach ($params as $k => $v) {
         $_GET[$k] = $v;
     }
     $app = $this->startApp();
     $app->getResponse()->on(YiiResponse::EVENT_AFTER_PREPARE, array($this, 'processResponse'));
     $this->headers = array();
     $this->statusCode = null;
     ob_start();
     $app->handleRequest($app->getRequest())->send();
     $content = ob_get_clean();
     // catch "location" header and display it in debug, otherwise it would be handled
     // by symfony browser-kit and not displayed.
     if (isset($this->headers['location'])) {
         Debug::debug("[Headers] " . json_encode($this->headers));
     }
     return new Response($content, $this->statusCode, $this->headers);
 }
开发者ID:gargallo,项目名称:tfs-test,代码行数:41,代码来源:Yii2.php

示例2: createOutputPath

 /**
  * Creates an output path, if it does not already exist
  */
 public function createOutputPath()
 {
     if (!file_exists($this->outputPath())) {
         mkdir($this->outputPath(), 0755, true);
         Debug::debug(sprintf('<info>Created output path </info><debug>%s</debug>', $this->outputPath()));
     }
 }
开发者ID:aedart,项目名称:scaffold,代码行数:10,代码来源:OutputPath.php

示例3: canObtainAllPaths

 /**
  * @test
  *
  * @covers ::all
  */
 public function canObtainAllPaths()
 {
     $paths = $this->makeFilesPaths(rand(3, 10));
     $collection = $this->makeFilesCollection($paths);
     Debug::debug($collection);
     $this->assertSame($paths, $collection->all());
 }
开发者ID:aedart,项目名称:scaffold,代码行数:12,代码来源:FilesTest.php

示例4: testValidatorBase

 public function testValidatorBase()
 {
     $validator = new Validator(__DIR__ . '/../_data/');
     $report = $validator->validate(["shopId" => 1, "serviceType" => "2", "order" => ["number" => "VAL0001", "date" => "2014-03-01"], "from" => ["name" => "YuTIn", "address" => "Taiwan, Taipei", "phone" => "0963066000"], "to" => ["name" => "YuTIn", "address" => "Taiwan, Taipei", "phone" => "0963066000"]], 'schema');
     Debug::debug($validator->getMessage());
     $this->assertTrue($report);
 }
开发者ID:yutin1987,项目名称:phalpro,代码行数:7,代码来源:ValidatorTest.php

示例5: listEntities

 private function listEntities($entityType)
 {
     Debug::debug("List {$entityType}");
     $response = $this->sendRequest("{$entityType}", null, 'GET');
     PHPUnit_Framework_Assert::assertGreaterThan(0, count($response->data));
     return $response;
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:7,代码来源:APICest.php

示例6: thumbnail

 public function thumbnail($pathToImage, $width, $height)
 {
     try {
         $this->openImage = $this->imagine->open(FileHelper::normalizePath($pathToImage))->thumbnail(new \Imagine\Image\Box($width, $height));
     } catch (\Exception $ex) {
         \Codeception\Util\Debug::debug($ex->getMessage());
     }
 }
开发者ID:black-lamp,项目名称:yii2-imagable,代码行数:8,代码来源:CreateImageImagine.php

示例7: debugCrud

 /**
  * Debug CRUD event result
  * @param \dlds\giixer\components\events\GxCrudEvent $e
  * @throws \yii\db\Exception
  */
 public function debugCrud(\dlds\giixer\components\events\GxCrudEvent $e)
 {
     if (!$e->model) {
         throw new \yii\db\Exception('Crud errors debug failed.');
     }
     \Codeception\Util\Debug::debug('Input:');
     \Codeception\Util\Debug::debug($e->input);
     \Codeception\Util\Debug::debug('Errors:');
     \Codeception\Util\Debug::debug($e->model->getErrors());
 }
开发者ID:dlds,项目名称:yii2-giixer,代码行数:15,代码来源:GxUnitTesterActions.php

示例8: log

 public function log($message, $level, $category = 'application')
 {
     if (!in_array($level, [\yii\log\Logger::LEVEL_INFO, \yii\log\Logger::LEVEL_WARNING, \yii\log\Logger::LEVEL_ERROR])) {
         return;
     }
     if (strpos($category, 'yii\\db\\Command') === 0) {
         return;
         // don't log queries
     }
     Debug::debug("[{$category}] {$message} ");
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:11,代码来源:Logger.php

示例9: testSchemaValidity

 public function testSchemaValidity()
 {
     $em = \Codeception\Module\Doctrine2::$em;
     $schema = new \Doctrine\ORM\Tools\SchemaValidator($em);
     $errors = $schema->validateMapping();
     $valid = count($errors) == 0;
     if (!$valid) {
         \Codeception\Util\Debug::debug($errors);
     }
     $this->assertEquals(true, $valid);
 }
开发者ID:facilis,项目名称:users,代码行数:11,代码来源:SchemaValidationTest.php

示例10: _testToAbsUrl

 protected function _testToAbsUrl($d, $base)
 {
     $path = '';
     $port = '';
     extract(parse_url($base));
     $root = (@$scheme ? $scheme . ':' : '') . '//' . $host . (@$port ? ':' . $port : '');
     //remove non-directory (file) part from the end of $path
     $path = preg_replace('@/([^/]*\\.)+[^/]*$@', '', $path);
     $clearBase = $root . $path;
     Debug::debug("\nTesting NLSDownloader::toAbsUrl() with base\nbase={$base}");
     Debug::debug('root=' . $root);
     Debug::debug('clearBase=' . $clearBase);
     Debug::debug(parse_url($base));
     //Absolute urls
     $rel = 'http://google.com';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($rel, $abs, 'Absolute URL mapped to itself');
     //Protocol-relative urls
     $rel = '//google.com/somefile.txt';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($scheme . ':' . $rel, $abs);
     //Queries
     $rel = '?x=1&y=2#somefragment';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($clearBase . $rel, $abs);
     //Fragments
     $rel = '#somefragment';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($clearBase . $rel, $abs);
     //Root-relative urls
     $rel = '/somepath2';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($root . $rel, $abs);
     $rel = '/somepath2/a/';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($root . $rel, $abs);
     $rel = '/somepath2/a.txt';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals($root . $rel, $abs);
     //Relative urls
     $rel = 'somepath2';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals(rtrim($clearBase, '/') . '/' . $rel, $abs);
     $rel = 'somepath2/a/./../a';
     $abs = $d->toAbsUrl($rel, $base);
     $this->assertEquals(rtrim($clearBase, '/') . '/somepath2/a', $abs);
     if (preg_match('@\\.css$@', $base)) {
         $rel = '../img/bg.png';
         $abs = $d->toAbsUrl($rel, $base);
         $this->assertEquals($root . '/img/bg.png', $abs);
     }
 }
开发者ID:nlac,项目名称:nlsclientscript,代码行数:52,代码来源:NLSDowloaderTest.php

示例11: doRequest

 /**
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  *
  * @return \Symfony\Component\BrowserKit\Response
  */
 public function doRequest($request)
 {
     $_COOKIE = $request->getCookies();
     $_SERVER = $request->getServer();
     $_FILES = $this->remapFiles($request->getFiles());
     $_REQUEST = $this->remapRequestParameters($request->getParameters());
     $_POST = $_GET = array();
     if (strtoupper($request->getMethod()) == 'GET') {
         $_GET = $_REQUEST;
     } else {
         $_POST = $_REQUEST;
     }
     $uri = $request->getUri();
     $pathString = parse_url($uri, PHP_URL_PATH);
     $queryString = parse_url($uri, PHP_URL_QUERY);
     $_SERVER['REQUEST_URI'] = $queryString === null ? $pathString : $pathString . '?' . $queryString;
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     parse_str($queryString, $params);
     foreach ($params as $k => $v) {
         $_GET[$k] = $v;
     }
     $app = $this->startApp();
     $app->getResponse()->on(YiiResponse::EVENT_AFTER_PREPARE, array($this, 'processResponse'));
     $this->headers = array();
     $this->statusCode = null;
     ob_start();
     $yiiRequest = $app->getRequest();
     $yiiRequest->setRawBody($request->getContent());
     try {
         $app->handleRequest($yiiRequest)->send();
     } catch (\Exception $e) {
         if ($e instanceof HttpException) {
             // we shouldn't discard existing output as PHPUnit preform output level verification since PHPUnit 4.2.
             $app->errorHandler->discardExistingOutput = false;
             $app->errorHandler->handleException($e);
         } elseif ($e instanceof ExitException) {
             // nothing to do
         } else {
             // for exceptions not related to Http, we pass them to Codeception
             throw $e;
         }
     }
     $content = ob_get_clean();
     // catch "location" header and display it in debug, otherwise it would be handled
     // by symfony browser-kit and not displayed.
     if (isset($this->headers['location'])) {
         Debug::debug("[Headers] " . json_encode($this->headers));
     }
     return new Response($content, $this->statusCode, $this->headers);
 }
开发者ID:kansey,项目名称:yii2albom,代码行数:56,代码来源:Yii2.php

示例12: testSetLanguageUrl

 public function testSetLanguageUrl()
 {
     $app = \Yii::$app;
     /** @var \bl\locale\UrlManager $urlManager */
     $urlManager = clone $app->urlManager;
     \Codeception\Util\Debug::debug("Before parse request app language: {$app->language}");
     $urlManager->detectInCookie = false;
     $urlManager->detectInSession = false;
     $language = 'uk-UA';
     $url = "{$language}/site/index";
     $request = $app->request;
     $request->setPathInfo($url);
     $parse = $urlManager->parseRequest($request);
     \Codeception\Util\Debug::debug("After parse request app language: {$app->language}");
     $this->tester->assertEquals($language, \Yii::$app->language);
 }
开发者ID:black-lamp,项目名称:yii2-locale,代码行数:16,代码来源:ParseRequestTest.php

示例13: createDirectoryRecursive

 /**
  * Create a directory recursive
  *
  * @param $path
  */
 public function createDirectoryRecursive($path)
 {
     // @todo UNIX ONLY?
     if (substr($path, 0, 1) !== '/') {
         $path = \Codeception\Configuration::projectDir() . $path;
     } elseif (!strstr($path, \Codeception\Configuration::projectDir())) {
         throw new \InvalidArgumentException('Can\'t create directroy "' . $path . '" as it is outside of the project root "' . \Codeception\Configuration::projectDir() . '"');
     }
     if (!is_dir(dirname($path))) {
         self::createDirectoryRecursive(dirname($path));
     }
     if (!is_dir($path)) {
         \Codeception\Util\Debug::debug('Directory "' . $path . '" does not exist. Try to create it ...');
         mkdir($path);
     }
 }
开发者ID:sascha-egerer,项目名称:css-regression,代码行数:21,代码来源:FileSystem.php

示例14: testHideDefaoultLanguage

 public function testHideDefaoultLanguage()
 {
     $mockApp = $this->app;
     /** @var \bl\locale\UrlManager $urlManager */
     $urlManager = clone $mockApp->urlManager;
     $urlManager->showDefault = false;
     $url = 'site/index';
     \Codeception\Util\Debug::debug("Default language: {$mockApp->sourceLanguage}");
     $actual = $urlManager->createUrl([$url, $urlManager->languageKey => 'en-US']);
     $expected = implode('/', ['', $url]);
     \Codeception\Util\Debug::debug("Hiden default language: {$actual}");
     $this->tester->assertEquals($expected, $actual);
     $language = 'ru-RU';
     $actual = $urlManager->createUrl([$url, $urlManager->languageKey => $language]);
     $expected = implode('/', ['', $language, $url]);
     \Codeception\Util\Debug::debug("Change language: {$actual}");
     $this->tester->assertEquals($actual, $expected);
 }
开发者ID:black-lamp,项目名称:yii2-locale,代码行数:18,代码来源:CreateUrlTest.php

示例15: canExecuteScripts

 /**
  * @test
  */
 public function canExecuteScripts()
 {
     // Get a log mock
     $log = $this->makeLogMock();
     $log->shouldReceive('info')->withAnyArgs();
     $targetA = $this->outputPath() . 'lsOutput.txt';
     $targetB = $this->outputPath() . 'lsAhlOutput.txt';
     $handler = $this->makeScriptsHandler($log);
     $scripts = [new CliScript(['script' => 'ls > ' . $targetA]), new CliScript(['script' => 'ls -ahl > ' . $targetB])];
     $handler->processElement($scripts);
     $this->assertFileExists($targetA, 'First script did not output!');
     $this->assertFileExists($targetB, 'Second script did not output!');
     $contentA = file_get_contents($targetA);
     $contentB = file_get_contents($targetB);
     Debug::debug($contentA);
     Debug::debug($contentB);
     $this->assertNotEmpty($contentA, 'First output file has no content');
     $this->assertNotEmpty($contentB, 'Second output file has no content');
 }
开发者ID:aedart,项目名称:scaffold,代码行数:22,代码来源:ScriptsHandlerTest.php


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