getMethod($method); $methodObj->setAccessible(true); return $methodObj->invokeArgs($object, $args); } public function testInvalidDataHandling() { $changeset = new CampaignAdminTest\InvalidChangeSet(); $admin = new CampaignAdmin(); $result = $this->callProtectedMethod($admin, 'getChangeSetResource', [$changeset] ); $this->assertEquals('Corrupt database! bad data' , $result['Description']); } }