/** * Testing loadAllOldVersions method. * * @since 2.0 * @dataProvider getActiveRecordProviders */ public function testLoadAllOldVersions($provider) { $config = ConfigProvider::getInstance(); $config->set('db.provider.name', $provider); $this->person->setMaintainHistory(true); $this->person->rebuildTable(); $this->person->set('displayName', 'unitTestUser1'); $this->person->save(); $this->assertEquals(1, $this->person->getHistoryCount(), 'Testing loadAllOldVersions method'); $this->assertEquals('unitTestUser1', $this->person->loadAllOldVersions($this->person->getOID())[0]->getDisplayName()->getValue()); $this->person->saveAttribute('displayName', 'unitTestUser2'); $this->assertEquals(2, $this->person->getHistoryCount(), 'Testing loadAllOldVersions method'); $this->assertEquals('unitTestUser1', $this->person->loadAllOldVersions($this->person->getOID())[0]->getDisplayName()->getValue()); $this->assertEquals('unitTestUser2', $this->person->loadAllOldVersions($this->person->getOID())[1]->getDisplayName()->getValue()); $this->person->dropTable('Person_history'); }