PHPUnit_Framework_Assert::assertNotEmpty PHP Method

assertNotEmpty() public static method

Asserts that a variable is not empty.
public static assertNotEmpty ( mixed $actual, string $message = '' )
$actual mixed
$message string
    public static function assertNotEmpty($actual, $message = '')
    {
        static::assertThat($actual, static::logicalNot(static::isEmpty()), $message);
    }

Usage Example

 /**
  * @Then /^I should see "(?P<text>[^"]*)" in (?P<tableName>[\w\d\-]+) table row with "(?P<row>[^"]*)"$/
  * @Then /^I should see "(?P<text>[^"]*)" in (?P<row>\d+)(st|nd|rd|th)? (?P<tableName>[\w\d\-]+) table row$/
  */
 public function assertTableRowContains($text, $row, $tableName)
 {
     $table = $this->findTable($tableName);
     $row = is_numeric($row) ? $table->getRow($row - 1) : $table->findRow($row);
     Assert::assertNotEmpty($row, "Couldn't find row {$row} in table: " . PHP_EOL . $table->dump());
     Assert::assertContains($text, $row, "Couldn't find {$text} in row " . $table->dumpRows(array($row)));
 }
All Usage Examples Of PHPUnit_Framework_Assert::assertNotEmpty
PHPUnit_Framework_Assert