I have a set of read-only tests and a couple of ones that modify data (insert/update/delete). I'd like to back up my tables, so each test class would have a list of associated tables that they'll modify. This is just test data.
I thus thought of this:
abstract class DataAlteringTestBase extends PHPUnit_Framework_TestCase
protected function setUp()
echo "backing up tables: " . $this->GetAlteredTableNames();
public abstract function GetAlteredTaleNames();
One of the subclasses:
class DataAlteringTest extends DataAlteringTestBase
public function testDummyStuffChild()
The problem is, I think, that PHPUnit tries to get the method implementation from the abstract class, rather than its children.
Call to undefined method DataAlteringTest::GetAlteredTableNames() -
the implementation ...\tests\DataAlteringTestBase.php:6 - the abstract
How to fix it? or is there something wrong with the idea of implementing this in PHP/PHPUnit in the first place?
You have a few typos - you wrote
GetAlteredTaleNames() in some places and
GetAlteredTableNames() in other places.