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


PHP PHPUnit_Util_Type::export方法代码示例

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


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

示例1: toString

 /**
  * {@inheritdoc}
  *
  * @todo Improve output using diff when expected and actual arguments of a
  *       command do not match.
  */
 public function toString()
 {
     $string = 'is a Redis command';
     if ($this->commandID) {
         $string .= " with ID '{$this->commandID}'";
     }
     if ($this->arguments) {
         $string .= " and the following arguments:\n\n";
         $string .= PHPUnit_Util_Type::export($this->arguments);
     }
     return $string;
 }
开发者ID:GeorgeBroadley,项目名称:caffeine-vendor,代码行数:18,代码来源:RedisCommandConstraint.php

示例2: invoke

 /**
  * @param PHPUnit_Framework_MockObject_Invocation $invocation
  * @return the invocation of the Entry with matching parameters.
  */
 public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation)
 {
     foreach ($this->return_map as $entry) {
         if ($entry->matches($invocation)) {
             return $entry->invoke($invocation);
         }
     }
     if ($this->default != NULL) {
         return $this->default->invoke($invocation);
     }
     PHPUnit_Framework_Assert::fail(sprintf('No return value defined for %s', PHPUnit_Util_Type::export($invocation->parameters)));
 }
开发者ID:basekit,项目名称:phpunit-extensions,代码行数:16,代码来源:ReturnMapping.php

示例3: assertArraySameValues

 public static function assertArraySameValues($expected, $actual)
 {
     $extra = array_diff($expected, $actual);
     $missing = array_diff($actual, $expected);
     CakeTestCase::assertSame($extra, $missing, "Got extra elements " . PHPUnit_Util_Type::export($extra) . " and some are elements missing " . PHPUnit_Util_Type::export($missing));
 }
开发者ID:Marcin11,项目名称:_mojePanstwo-Portal,代码行数:6,代码来源:MpAssertions.php

示例4: assertEquals

 /**
  * Asserts that two values are equal.
  *
  * @param  mixed $expected The first value to compare
  * @param  mixed $actual The second value to compare
  * @param  float $delta The allowed numerical distance between two values to
  *                      consider them equal
  * @param  bool  $canonicalize If set to TRUE, arrays are sorted before
  *                             comparison
  * @param  bool  $ignoreCase If set to TRUE, upper- and lowercasing is
  *                           ignored when comparing string values
  * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison
  *                           fails. Contains information about the
  *                           specific errors that lead to the failure.
  */
 public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE)
 {
     if (is_infinite($actual) && is_infinite($expected)) {
         return;
     }
     if ((is_infinite($actual) xor is_infinite($expected)) || (is_nan($actual) or is_nan($expected)) || abs($actual - $expected) > $delta) {
         throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, '', '', FALSE, sprintf('Failed asserting that %s matches expected %s.', PHPUnit_Util_Type::export($actual), PHPUnit_Util_Type::export($expected)));
     }
 }
开发者ID:deepakb,项目名称:test-driven-development-example,代码行数:24,代码来源:Numeric.php

示例5: assertEquals

 /**
  * Asserts that two values are equal.
  *
  * @param  mixed $expected The first value to compare
  * @param  mixed $actual The second value to compare
  * @param  float $delta The allowed numerical distance between two values to
  *                      consider them equal
  * @param  bool  $canonicalize If set to TRUE, arrays are sorted before
  *                             comparison
  * @param  bool  $ignoreCase If set to TRUE, upper- and lowercasing is
  *                           ignored when comparing string values
  * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison
  *                           fails. Contains information about the
  *                           specific errors that lead to the failure.
  */
 public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE)
 {
     if ($actual != $expected) {
         throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, PHPUnit_Util_Type::export($expected), PHPUnit_Util_Type::export($actual));
     }
 }
开发者ID:DieguinhoHR,项目名称:kratos_store,代码行数:21,代码来源:Resource.php

示例6: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     if (is_string($this->value) && strpos($this->value, "\n") !== FALSE) {
         return 'contains "' . $this->value . '"';
     } else {
         return 'contains ' . PHPUnit_Util_Type::export($this->value);
     }
 }
开发者ID:SebFav,项目名称:ApplicationInternet2,代码行数:13,代码来源:TraversableContains.php

示例7: toString

 public function toString()
 {
     return sprintf('has items %s', PHPUnit_Util_Type::export($this->expected));
 }
开发者ID:basekit,项目名称:phpunit-extensions,代码行数:4,代码来源:HasItems.php

示例8: getNumber

 /**
  * Send a command to the Selenium RC server and treat the result
  * as a number.
  *
  * @param  string $command
  * @param  array  $arguments
  * @return numeric
  * @author Shin Ohno <ganchiku@gmail.com>
  * @author Bjoern Schotte <schotte@mayflower.de>
  */
 protected function getNumber($command, array $arguments)
 {
     $result = $this->getString($command, $arguments);
     if (!is_numeric($result)) {
         throw new PHPUnit_Framework_Exception('Result is not numeric: ' . PHPUnit_Util_Type::export($result));
     }
     return $result;
 }
开发者ID:nbalonso,项目名称:MunkiFace,代码行数:18,代码来源:Driver.php

示例9: assertEquals

 /**
  * Asserts that two values are equal.
  *
  * @param  mixed $expected The first value to compare
  * @param  mixed $actual The second value to compare
  * @param  float $delta The allowed numerical distance between two values to
  *                      consider them equal
  * @param  bool  $canonicalize If set to TRUE, arrays are sorted before
  *                             comparison
  * @param  bool  $ignoreCase If set to TRUE, upper- and lowercasing is
  *                           ignored when comparing string values
  * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison
  *                           fails. Contains information about the
  *                           specific errors that lead to the failure.
  */
 public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE)
 {
     $expectedToCompare = $expected;
     $actualToCompare = $actual;
     // always compare as strings to avoid strange behaviour
     // otherwise 0 == 'Foobar'
     if (is_string($expected) || is_string($actual)) {
         $expectedToCompare = (string) $expectedToCompare;
         $actualToCompare = (string) $actualToCompare;
         if ($ignoreCase) {
             $expectedToCompare = strtolower($expectedToCompare);
             $actualToCompare = strtolower($actualToCompare);
         }
     }
     if ($expectedToCompare != $actualToCompare) {
         if (is_string($expected) && is_string($actual)) {
             throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, PHPUnit_Util_Type::export($expected), PHPUnit_Util_Type::export($actual), FALSE, 'Failed asserting that two strings are equal.');
         }
         throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, '', '', FALSE, sprintf('Failed asserting that %s matches expected %s.', PHPUnit_Util_Type::export($actual), PHPUnit_Util_Type::export($expected)));
     }
 }
开发者ID:SebFav,项目名称:ApplicationInternet2,代码行数:36,代码来源:Scalar.php

示例10: assertEquals

 /**
  * Asserts that two values are equal.
  *
  * @param  mixed $expected     The first value to compare
  * @param  mixed $actual       The second value to compare
  * @param  float $delta        The allowed numerical distance between two values to
  *                             consider them equal
  * @param  bool  $canonicalize If set to TRUE, arrays are sorted before
  *                             comparison
  * @param  bool  $ignoreCase   If set to TRUE, upper- and lowercasing is
  *                             ignored when comparing string values
  *
  * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison
  *                           fails. Contains information about the
  *                           specific errors that lead to the failure.
  */
 public function assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false)
 {
     foreach ($actual as $object) {
         if (!$expected->contains($object)) {
             throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, PHPUnit_Util_Type::export($expected), PHPUnit_Util_Type::export($actual), false, 'Failed asserting that two objects are equal.');
         }
     }
     foreach ($expected as $object) {
         if (!$actual->contains($object)) {
             throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, PHPUnit_Util_Type::export($expected), PHPUnit_Util_Type::export($actual), false, 'Failed asserting that two objects are equal.');
         }
     }
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:29,代码来源:SplObjectStorage.php

示例11: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     return 'has the same values with ' . PHPUnit_Util_Type::export($this->value);
 }
开发者ID:blast007,项目名称:bzion,代码行数:9,代码来源:ArraysHaveEqualValuesConstraint.php

示例12: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     return sprintf('%s Reason: %s', PHPUnit_Util_Type::export($this->value), $this->failure_reason);
 }
开发者ID:pansot2,项目名称:PadCMS-backend,代码行数:9,代码来源:DataSetIsEqual.php

示例13: toString

 public function toString()
 {
     return sprintf('equals ignoring whitespace %s', PHPUnit_Util_Type::export($this->normalize($this->expected)));
 }
开发者ID:basekit,项目名称:phpunit-extensions,代码行数:4,代码来源:StringMatchIgnoreWhitespace.php

示例14: assertEquals

 /**
  * Asserts that two values are equal.
  *
  * @param  mixed $expected The first value to compare
  * @param  mixed $actual The second value to compare
  * @param  float $delta The allowed numerical distance between two values to
  *                      consider them equal
  * @param  bool  $canonicalize If set to TRUE, arrays are sorted before
  *                             comparison
  * @param  bool  $ignoreCase If set to TRUE, upper- and lowercasing is
  *                           ignored when comparing string values
  * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison
  *                           fails. Contains information about the
  *                           specific errors that lead to the failure.
  */
 public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE, array &$processed = array())
 {
     if ($canonicalize) {
         sort($expected);
         sort($actual);
     }
     $remaining = $actual;
     $expString = $actString = "Array (\n";
     $equal = TRUE;
     foreach ($expected as $key => $value) {
         unset($remaining[$key]);
         if (!array_key_exists($key, $actual)) {
             $expString .= sprintf("    %s => %s\n", PHPUnit_Util_Type::export($key), PHPUnit_Util_Type::shortenedExport($value));
             $equal = FALSE;
             continue;
         }
         try {
             $this->factory->getComparatorFor($value, $actual[$key])->assertEquals($value, $actual[$key], $delta, $canonicalize, $ignoreCase, $processed);
             $expString .= sprintf("    %s => %s\n", PHPUnit_Util_Type::export($key), PHPUnit_Util_Type::shortenedExport($value));
             $actString .= sprintf("    %s => %s\n", PHPUnit_Util_Type::export($key), PHPUnit_Util_Type::shortenedExport($actual[$key]));
         } catch (PHPUnit_Framework_ComparisonFailure $e) {
             $expString .= sprintf("    %s => %s\n", PHPUnit_Util_Type::export($key), $e->getExpectedAsString() ? $this->indent($e->getExpectedAsString()) : PHPUnit_Util_Type::shortenedExport($e->getExpected()));
             $actString .= sprintf("    %s => %s\n", PHPUnit_Util_Type::export($key), $e->getActualAsString() ? $this->indent($e->getActualAsString()) : PHPUnit_Util_Type::shortenedExport($e->getActual()));
             $equal = FALSE;
         }
     }
     foreach ($remaining as $key => $value) {
         $actString .= sprintf("    %s => %s\n", PHPUnit_Util_Type::export($key), PHPUnit_Util_Type::shortenedExport($value));
         $equal = FALSE;
     }
     $expString .= ')';
     $actString .= ')';
     if (!$equal) {
         throw new PHPUnit_Framework_ComparisonFailure($expected, $actual, $expString, $actString, FALSE, 'Failed asserting that two arrays are equal.');
     }
 }
开发者ID:DieguinhoHR,项目名称:kratos_store,代码行数:51,代码来源:Array.php

示例15: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     return 'has the key ' . PHPUnit_Util_Type::export($this->key);
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:9,代码来源:ArrayHasKey.php


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