test() public méthode

Tests the expectation. True if it differs from the held value.
public test ( mixed $compare ) : boolean
$compare mixed Comparison value.
Résultat boolean True if correct.
 function testType()
 {
     $string = new NotIdenticalExpectation("37");
     $this->assertTrue($string->test("38"));
     $this->assertTrue($string->test(37));
     $this->assertFalse($string->test("37"));
 }
Exemple #2
0
 function testType()
 {
     $string = new NotIdenticalExpectation("37");
     $this->assertTrue($string->test("38"));
     $this->assertTrue($string->test(37));
     $this->assertFalse($string->test("37"));
     $this->assertPattern('/at character 1/', $string->testMessage("38"));
     $this->assertPattern('/passes.*?type/', $string->testMessage(37));
 }
 public function testType()
 {
     $string = new NotIdenticalExpectation('37');
     $this->assertTrue($string->test('38'));
     $this->assertTrue($string->test(37));
     $this->assertFalse($string->test('37'));
 }