PHPUnit_Framework_Assert::fail PHP Method

fail() public static method

Fails a test with the given message.
public static fail ( string $message = '' )
$message string
    public static function fail($message = '')
    {
        self::$count++;
        throw new PHPUnit_Framework_AssertionFailedError($message);
    }

Usage Example

Example #1
0
 /**
  * Deletes a file
  *
  * ``` php
  * <?php
  * $I->deleteFile('composer.lock');
  * ?>
  * ```
  *
  * @param $filename
  */
 public function deleteFile($filename)
 {
     if (!file_exists($this->absolutizePath($filename))) {
         \PHPUnit_Framework_Assert::fail('file not found');
     }
     unlink($this->absolutizePath($filename));
 }
All Usage Examples Of PHPUnit_Framework_Assert::fail
PHPUnit_Framework_Assert