test() public method

Tests the expectation. True if the type or class matches the string value.
public test ( string $compare ) : boolean
$compare string Comparison value.
return boolean True if correct.
コード例 #1
0
ファイル: expectation_test.php プロジェクト: Zunair/xataface
 function testInt()
 {
     $expectation = new IsAExpectation('int');
     $this->assertTrue($expectation->test(5));
     $this->assertFalse($expectation->test(5.0));
 }
コード例 #2
0
 /**
  *    Tests the expectation. False if the type or
  *    class matches the string value.
  *    @param string $compare        Comparison value.
  *    @return boolean               True if different.
  *    @access public
  */
 function test($compare)
 {
     return !parent::test($compare);
 }
コード例 #3
0
 function testNull()
 {
     $expectation = new IsAExpectation('null');
     $this->assertTrue($expectation->test(null));
     $this->assertFalse($expectation->test('string'));
 }