update(DMS::class, 'folder_name', $this->testDmsPath); DMSFilesystemTestHelper::delete($this->testDmsPath); } /** * Delete the test folder after the tests run * * {@inheritDoc} */ public function tearDown() { parent::tearDown(); DMSFilesystemTestHelper::delete($this->testDmsPath); // Set the old DMS folder back again DMSDocument_versions::$enable_versions = self::$dmsEnableVersionsOld; } public function testDMSVersionStorage() { $this->markTestSkipped('Needs re-implementation, this test is not consistent.'); $dms = DMS::inst(); $document = $dms->storeDocument(self::$testFile); $this->assertNotNull($document, "Document object created"); $this->assertTrue( file_exists( DMS::inst()->getStoragePath() . DIRECTORY_SEPARATOR . $document->Folder . DIRECTORY_SEPARATOR . $document->Filename ), "Document file copied into DMS folder" ); $document->replaceDocument(self::$testFile2); $document->replaceDocument(self::$testFile); $document->replaceDocument(self::$testFile2); $document->replaceDocument(self::$testFile); $versionsList = $document->getVersions(); $this->assertEquals(4, $versionsList->Count(), "4 Versions created"); $versionsArray = $versionsList->toArray(); $this->assertEquals($versionsArray[0]->VersionCounter, 1, "Correct version count"); $this->assertEquals($versionsArray[1]->VersionCounter, 2, "Correct version count"); $this->assertEquals($versionsArray[2]->VersionCounter, 3, "Correct version count"); $this->assertEquals($versionsArray[3]->VersionCounter, 4, "Correct version count"); } }