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


PHP PHPUnit_Util_Type::toString方法代码示例

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


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

示例1: toString

    public function toString()
    {
        return sprintf(
          'return user-specified value %s',

          PHPUnit_Util_Type::toString($this->value)
        );
    }
开发者ID:schwarer2006,项目名称:wikia,代码行数:8,代码来源:Return.php

示例2: toString

    public function toString()
    {
        return sprintf(
          'raise user-specified exception %s',

          PHPUnit_Util_Type::toString($this->exception)
        );
    }
开发者ID:schwarer2006,项目名称:wikia,代码行数:8,代码来源:Exception.php

示例3: 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);
         }
     }
     PHPUnit_Framework_Assert::fail(sprintf('No return value defined for %s', PHPUnit_Util_Type::toString($invocation->parameters)));
 }
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:13,代码来源:ReturnMapping.php

示例4: toString

    /**
     * Returns a string describing the type difference between the expected
     * and the actual value.
     */
    public function toString()
    {
        return sprintf(
          '%s does not match expected type "%s".',

          PHPUnit_Util_Type::toString($this->actual),
          gettype($this->expected)
        );
    }
开发者ID:schwarer2006,项目名称:wikia,代码行数:13,代码来源:Type.php

示例5: getActualValue

 /**
  * For layout, actual value should be always set
  * (non-PHPdoc)
  * @see Mage_PHPUnit_Constraint_Abstract::getActualValue()
  */
 protected function getActualValue($other)
 {
     if ($this->_useActualValue) {
         if (is_array($this->_actualValue)) {
             return PHPUnit_Util_Type::toString($this->_actualValue);
         }
         return parent::getActualValue($other);
     }
     return '';
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:15,代码来源:Abstract.php

示例6: toString

    /**
     * Returns a string describing the difference between the expected and the
     * actual scalar value.
     */
    public function toString()
    {
        return sprintf(
          'Failed asserting that %s %s %s.',

          PHPUnit_Util_Type::toString($this->actual),
          $this->identical ? 'is identical to' : 'matches expected',
          PHPUnit_Util_Type::toString($this->expected)
        );
    }
开发者ID:schwarer2006,项目名称:wikia,代码行数:14,代码来源:Scalar.php

示例7: getActualValue

 /**
  * Returning user friendly actual value
  * (non-PHPdoc)
  * @see Mage_PHPUnit_Constraint_Abstract::getActualValue()
  */
 protected function getActualValue($other)
 {
     if ($this->_useActualValue) {
         if ($this->_actualValue instanceof Varien_Object) {
             $value = $this->_actualValue->debug();
         } else {
             $value = $this->_actualValue;
         }
         return PHPUnit_Util_Type::toString($value);
     }
     return '';
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:17,代码来源:Property.php

示例8: fail

 public function fail($other, $description, \SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL)
 {
     throw new PHPUnit_Framework_ExpectationFailedException(sprintf('%sFailed asserting that %s contains a query element that restricts the search to groups', !empty($description) ? $description . "\n" : '', PHPUnit_Util_Type::toString($other, TRUE)), NULL);
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:4,代码来源:Restrictgroups.php

示例9: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     return 'is greater than ' . PHPUnit_Util_Type::toString($this->value);
 }
开发者ID:maximseshuk,项目名称:lz77-kit,代码行数:9,代码来源:GreaterThan.php

示例10: toString

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

示例11: shortenedString

 public static function shortenedString($string)
 {
     $string = preg_replace('#\\n|\\r\\n|\\r#', ' ', $string);
     if (strlen($string) > 14) {
         return PHPUnit_Util_Type::toString(substr($string, 0, 7) . '...' . substr($string, -7));
     } else {
         return PHPUnit_Util_Type::toString($string);
     }
 }
开发者ID:xiplias,项目名称:pails,代码行数:9,代码来源:Type.php

示例12: 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)) {
         $this->stop();
         throw new PHPUnit_Framework_Exception('Result is not numeric: ' . PHPUnit_Util_Type::toString($result, TRUE));
     }
     return $result;
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:19,代码来源:Driver.php

示例13: toString

 /**
  * Returns a string describing the difference between the expected and the
  * actual array.
  *
  * @return string
  */
 public function toString()
 {
     if (!$this->identical) {
         ksort($this->expected);
         ksort($this->actual);
     }
     $diff = PHPUnit_Util_Diff::diff(print_r($this->expected, TRUE), print_r($this->actual, TRUE));
     if ($diff !== FALSE) {
         return trim($diff);
     }
     // Fallback: Either diff is not available or the print_r() output for
     // the expected and the actual array are equal (but the arrays are not).
     $expectedOnly = array();
     $actualOnly = array();
     $diff = '';
     foreach ($this->expected as $expectedKey => $expectedValue) {
         if (!array_key_exists($expectedKey, $this->actual)) {
             $expectedOnly[] = $expectedKey;
             continue;
         }
         if ($expectedValue === $this->actual[$expectedKey]) {
             continue;
         }
         $diffObject = PHPUnit_Framework_ComparisonFailure::diffIdentical($expectedValue, $this->actual[$expectedKey], sprintf('%sarray key %s: ', $this->message, PHPUnit_Util_Type::toString($expectedKey)));
         $diff .= $diffObject->toString() . "\n";
     }
     foreach ($this->actual as $actualKey => $actualValue) {
         if (!array_key_exists($actualKey, $this->expected)) {
             $actualOnly[] = $actualKey;
             continue;
         }
     }
     foreach ($expectedOnly as $expectedKey) {
         $diff .= sprintf("array key %s: only in expected %s\n", PHPUnit_Util_Type::toString($expectedKey), PHPUnit_Util_Type::toString($this->expected[$expectedKey]));
     }
     foreach ($actualOnly as $actualKey) {
         $diff .= sprintf("array key %s: only in actual %s\n", PHPUnit_Util_Type::toString($actualKey), PHPUnit_Util_Type::toString($this->actual[$actualKey]));
     }
     return $diff;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:46,代码来源:Array.php

示例14: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     return "is equivalent to the SQL query " . \PHPUnit_Util_Type::toString($this->sql);
 }
开发者ID:Nycto,项目名称:Round-Eights,代码行数:9,代码来源:SQL.php

示例15: toString

 /**
  * Returns a string representation of the constraint.
  *
  * @return string
  */
 public function toString()
 {
     return "produces" . \PHPUnit_Util_Type::toString($this->value) . "when iterated over";
 }
开发者ID:Nycto,项目名称:Round-Eights,代码行数:9,代码来源:Iterator.php


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