當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。