Skip to content

Commit

Permalink
Merge pull request #345 from creative-commoners/pulls/1/dms
Browse files Browse the repository at this point in the history
MNT Remove polyfill
  • Loading branch information
maxime-rainville committed Nov 9, 2021
2 parents 775371a + 2128a65 commit a0a216c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
},
"require-dev": {
"silverstripe/recipe-testing": "^2",
"dms/phpunit-arraysubset-asserts": "^0.3.0",
"silverstripe/graphql": "^3.5 || ^4",
"squizlabs/php_codesniffer": "^3"
},
Expand Down
19 changes: 15 additions & 4 deletions tests/php/VersionedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

class VersionedTest extends SapphireTest
{
use ArraySubsetAsserts;

protected static $fixture_file = 'VersionedTest.yml';

public static $extra_dataobjects = [
Expand Down Expand Up @@ -664,7 +662,13 @@ public function testGetVersion()
'Versioned.stage' => Versioned::DRAFT,
];
$this->assertEquals($archiveParms, $page2v1->getInheritableQueryParams());
$this->assertArraySubset($archiveParms, $page2v1->Children()->getQueryParams());
$queryParms = $page2v1->Children()->getQueryParams();
foreach ($queryParms as $key => $val) {
if (!array_key_exists($key, $archiveParms)) {
continue;
}
$this->assertSame($val, $queryParms[$key], "queryParms[$key] should be $val");
}
$this->assertListEquals(
[
['Title' => 'Page 2a'],
Expand All @@ -686,7 +690,13 @@ public function testGetVersion()
'Versioned.stage' => Versioned::DRAFT,
];
$this->assertEquals($archiveParms, $page2v2->getInheritableQueryParams());
$this->assertArraySubset($archiveParms, $page2v2->Children()->getQueryParams());
$queryParms = $page2v1->Children()->getQueryParams();
foreach ($queryParms as $key => $val) {
if (!array_key_exists($key, $archiveParms)) {
continue;
}
$this->assertSame($val, $queryParms[$key], "queryParms[$key] should be $val");
}
$this->assertListEquals(
[
['Title' => 'Page 2a - v2'],
Expand Down Expand Up @@ -1304,6 +1314,7 @@ public function testVersionedHandlesRenamedDataObjectFields()
$testData = new VersionedTest\RelatedWithoutversion();
$testData->NewField = 'Test';
$testData->write();
$this->assertTrue(true, 'No exceptions were thrown');
}

public function testCanView()
Expand Down

0 comments on commit a0a216c

Please sign in to comment.