You are here

function DrupalTestCase::assertCopy in SimpleTest 6

Same name and namespace in other branches
  1. 5 drupal_test_case.php \DrupalTestCase::assertCopy()

Will trigger a pass if both parameters refer to different objects. Fail otherwise.

Parameters

mixed $first Object reference to check.: @param mixed $second Hopefully not the same object. @param string $message Message to display. @return boolean True on pass @access public

File

./drupal_test_case.php, line 710

Class

DrupalTestCase
Test case for typical Drupal tests. Extends WebTestCase for comfortable browser usage but also implements all UnitTestCase methods, I wish WebTestCase would do this.

Code

function assertCopy(&$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
    ->assertFalse(SimpleTestCompatibility::isReference($first, $second), $message);
}