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


PHP SimpleTestCompatibility::isIdentical方法代码示例

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


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

示例1: isArrayOfIdenticalTypes

 /**
  *    Recursive type test for each element of an array.
  *    @param mixed $first    Test subject.
  *    @param mixed $second   Comparison object.
  *    @return boolean        True if identical.
  *    @access private
  */
 protected static function isArrayOfIdenticalTypes($first, $second)
 {
     if (array_keys($first) != array_keys($second)) {
         return false;
     }
     foreach (array_keys($first) as $key) {
         $is_identical = SimpleTestCompatibility::isIdentical($first[$key], $second[$key]);
         if (!$is_identical) {
             return false;
         }
     }
     return true;
 }
开发者ID:VasuLief,项目名称:simpletest,代码行数:20,代码来源:compatibility.php

示例2: test

 /**
  *    Tests the expectation. True if it exactly
  *    matches the held value.
  *    @param mixed $compare        Comparison value.
  *    @return boolean              True if correct.
  *    @access public
  */
 function test($compare)
 {
     return SimpleTestCompatibility::isIdentical($this->_getValue(), $compare);
 }
开发者ID:clickdimension,项目名称:tinybutstrong,代码行数:11,代码来源:expectation.php

示例3: isIdentical

 /**
  *    Identity test. Drops back to equality for PHP5
  *    objects as the === operator counts as the
  *    stronger reference constraint.
  *    @param mixed $first    Test subject.
  *    @param mixed $second   Comparison object.
  *    @access public
  *    @static
  */
 function isIdentical($first, $second)
 {
     if (version_compare(phpversion(), '5') >= 0) {
         if (gettype($first) != gettype($second)) {
             return false;
         }
         if ($first != $second) {
             return false;
         }
         if (is_object($first) && is_object($second)) {
             return get_class($first) == get_class($second);
         }
         if (is_array($first) && is_array($second)) {
             if (array_keys($first) != array_keys($second)) {
                 return false;
             }
             foreach (array_keys($first) as $key) {
                 if (!SimpleTestCompatibility::isIdentical($first[$key], $second[$key])) {
                     return false;
                 }
             }
         }
         return true;
     }
     return $first === $second;
 }
开发者ID:BGCX067,项目名称:ezpdo2-svn-to-git,代码行数:35,代码来源:options.php

示例4: test

 /**
  * Tests the expectation. True if it exactly matches the held value.
  *
  * @param mixed $compare Comparison value.
  * @return boolean
  */
 public function test($compare)
 {
     $value = $this->entityToFilteredArray($this->getValue());
     $compare = $this->entityToFilteredArray($compare);
     return SimpleTestCompatibility::isIdentical($value, $compare);
 }
开发者ID:elgg,项目名称:elgg,代码行数:12,代码来源:ElggCoreUnitTest.php


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