ReferenceExpectation::test PHP Méthode

test() public méthode

Tests the expectation. True if it exactly references the held value.
public test ( mixed &$compare ) : boolean
$compare mixed Comparison reference.
Résultat boolean True if correct.
    public function test(&$compare)
    {
        return SimpleTestCompatibility::isReference($this->value, $compare);
    }

Usage Example

 function testReference()
 {
     $foo = "foo";
     $ref =& $foo;
     $not_ref = $foo;
     $bar = "bar";
     $expect = new ReferenceExpectation($foo);
     $this->assertTrue($expect->test($ref));
     $this->assertFalse($expect->test($not_ref));
     $this->assertFalse($expect->test($bar));
 }
All Usage Examples Of ReferenceExpectation::test