sebastianbergmann/phpunit — Issue #489: PHPUnit_Extensions_Database_TestCase::assertTableRowCount uses $this in object context
Author: huyi1985
Created: 2012-02-07 07:21:44+00:00
State: open

PHPUnit/Extensions/Database/TestCase.php on line 261

/**
* Assert that a given table has a given amount of rows
*
* @param string $tableName Name of the table
* @param int $expected Expected amount of rows in the table
* @param string $message Optional message
*/
public static function assertTableRowCount($tableName, $expected, $message = '')
-------------^
{
$constraint = new PHPUnit_Extensions_Database_Constraint_TableRowCount($tableName, $expected);
$actual = $this->getConnection()->getRowCount($tableName);
--------------------^
self::assertThat($actual, $constraint, $message);
}

DbUnit Extension Version: 1.1.2

When I call this method, PHP will report 'PHP Fatal error: Using $this when not in object context in /usr/share/php/PHPUnit/Extensions/Database/TestCase.php on line 261'