Merge pull request #4954 from tractorcow/pulls/3.3/version-fixes

BUG Fix VersionedTest sometimes failing given certain querystring arguments
This commit is contained in:
Daniel Hensby 2016-01-22 18:53:21 +00:00
commit e9d45b4d5f

View File

@ -639,6 +639,8 @@ class VersionedTest extends SapphireTest {
$this->assertArrayNotHasKey('readingMode', $session2->inst_changedData()); $this->assertArrayNotHasKey('readingMode', $session2->inst_changedData());
// Test choose_site_stage // Test choose_site_stage
unset($_GET['stage']);
unset($_GET['archiveDate']);
Session::set('readingMode', 'Stage.Stage'); Session::set('readingMode', 'Stage.Stage');
Versioned::choose_site_stage(); Versioned::choose_site_stage();
$this->assertEquals('Stage.Stage', Versioned::get_reading_mode()); $this->assertEquals('Stage.Stage', Versioned::get_reading_mode());
@ -662,8 +664,8 @@ class VersionedTest extends SapphireTest {
/** /**
* Ensures that the latest version of a record is the expected value * Ensures that the latest version of a record is the expected value
* *
* @param type $record * @param DataObject $record
* @param type $version * @param int $version
*/ */
protected function assertRecordHasLatestVersion($record, $version) { protected function assertRecordHasLatestVersion($record, $version) {
foreach(ClassInfo::ancestry(get_class($record), true) as $table) { foreach(ClassInfo::ancestry(get_class($record), true) as $table) {