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


PHP SimpleTestCompatibility::isReference方法代码示例

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


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

示例1: testObjectReferences

 public function testObjectReferences()
 {
     $object = new ComparisonClass();
     $object_reference = $object;
     $object_copy = new ComparisonClass();
     $object_assignment = $object;
     $this->assertTrue(SimpleTestCompatibility::isReference($object, $object));
     $this->assertTrue(SimpleTestCompatibility::isReference($object, $object_reference));
     $this->assertFalse(SimpleTestCompatibility::isReference($object, $object_copy));
     $this->assertTrue(SimpleTestCompatibility::isReference($object, $object_assignment));
 }
开发者ID:VasuLief,项目名称:simpletest,代码行数:11,代码来源:compatibility_test.php

示例2: testObjectReferences

 function testObjectReferences()
 {
     $object = new ComparisonClass();
     $object_reference =& $object;
     $object_copy = new ComparisonClass();
     $object_assignment = $object;
     $this->assertTrue(SimpleTestCompatibility::isReference($object, $object));
     $this->assertTrue(SimpleTestCompatibility::isReference($object, $object_reference));
     $this->assertFalse(SimpleTestCompatibility::isReference($object, $object_copy));
     if (version_compare(phpversion(), '5', '>=')) {
         $this->assertTrue(SimpleTestCompatibility::isReference($object, $object_assignment));
     } else {
         $this->assertFalse(SimpleTestCompatibility::isReference($object, $object_assignment));
     }
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:15,代码来源:options_test.php

示例3: testAddTwice

 function testAddTwice()
 {
     $parent = $this->generateSection(0);
     $section1 = $this->generateSection(0);
     $fakeSection1 = $this->generateSection(0);
     //will generate with the
     //same data as the section above
     $this->assertFalse(SimpleTestCompatibility::isReference($section1, $fakeSection1));
     //add once
     $parent->add($section1);
     $resultSection =& $parent->get($section1->getId());
     $this->assertNotNull($resultSection);
     $this->assertSectionsEqual($section1, $resultSection);
     //add again
     $result = $parent->add($section1);
     $this->assertTrue(PEAR::isError($result));
     $this->assertNotNull($parent->get($section1->getId()));
     //add other
     $result = $parent->add($fakeSection1);
     $this->assertTrue(PEAR::isError($result));
 }
开发者ID:akirsch,项目名称:revive-adserver,代码行数:21,代码来源:MenuSection.admin.test.php

示例4: assertNotSame

 /**
  *    In PHP5 the identity test tests for the same
  *    object. This is a reference test in PHP4.
  *    @param $first          First object handle.
  *    @param $second         Hopefully a different handle.
  *    @param $message        Message to display.
  *    @public
  */
 function assertNotSame(&$first, &$second, $message = "%s")
 {
     $dumper =& new SimpleDumper();
     $message = sprintf($message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should not be the same object");
     return $this->assert(new falseExpectation(), SimpleTestCompatibility::isReference($first, $second), $message);
 }
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:14,代码来源:pear_test_case.php

示例5: test

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

示例6: assertNotSame

 /**
  * Inverted identity test.
  *
  * @param $first          First object handle.
  * @param $second         Hopefully a different handle.
  * @param $message        Message to display.
  */
 public function assertNotSame($first, $second, $message = '%s')
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, '[' . $dumper->describeValue($first) . '] and [' . $dumper->describeValue($second) . '] should not be the same object');
     return $this->assert(new falseExpectation(), SimpleTestCompatibility::isReference($first, $second), $message);
 }
开发者ID:guicara,项目名称:simpletest,代码行数:13,代码来源:pear_test_case.php

示例7: be_copy_of

 function be_copy_of(&$first, &$second, $message = '%s')
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should not be the same object");
     return $this->runtime->assert(new FaseExpectation(), SimpleTestCompatibility::isReference($first, $second), $message);
 }
开发者ID:herlambang,项目名称:h2o-php,代码行数:6,代码来源:spec.php


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