-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Stop using deprecated API #526
API Stop using deprecated API #526
Conversation
0793ba0
to
019d9fc
Compare
@@ -11,7 +11,6 @@ | |||
use SilverStripe\Core\Injector\Injector; | |||
use SilverStripe\Dev\FunctionalTest; | |||
use SilverStripe\Control\HTTPResponse; | |||
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deprecated class was unused
019d9fc
to
576e180
Compare
$store = reset($params); | ||
if (!$store instanceof AssetContainer) { | ||
/** @var AssetContainer $assetContainer */ | ||
$assetContainer = reset($params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed this variable because it was confusing me
@@ -74,6 +75,9 @@ protected function tearDown(): void | |||
*/ | |||
public function testSanityCheck() | |||
{ | |||
if (Deprecation::get_is_enabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I possibly could have called $this->markTestSkipped()
in setUp()
. However I still prefer to call $this->markTestSkipped()
on test individually so that we're being consistent with most of the the other unit-tests
735bf3c
to
68dcccb
Compare
{ | ||
parent::setUp(); | ||
if (Deprecation::get_is_enabled()) { | ||
$this->markTestSkipped('Test calls deprecated code'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking test as skipped in setUp() rather than on individual test*() because this is a strange unit test where the bulk of the tests are in parent class FileIDHelperTester()
{ | ||
parent::setUp(); | ||
if (Deprecation::get_is_enabled()) { | ||
$this->markTestSkipped('Test calls deprecated code'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking test as skipped in setUp() rather than on individual test*() because this is a strange unit test where the bulk of the tests are in parent class FileIDHelperTester()
@@ -899,6 +921,98 @@ public function listOfFilesToNormalise() | |||
$public = AssetStore::VISIBILITY_PUBLIC; | |||
$protected = AssetStore::VISIBILITY_PROTECTED; | |||
|
|||
/** @var FileIDHelper $hashHelper */ | |||
$hashHelper = new HashFileIDHelper(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a couple of the unit-test + provider combinations, I've duplicated the methods and retained the deprecated code in methods that have WithLegacy()
suffixed to them.
4dd43cd
to
895af35
Compare
f59e1f0
to
2b75615
Compare
2b75615
to
a7c323b
Compare
Issue silverstripe/silverstripe-framework#10542
CI won't pass until silverstripe/silverstripe-framework#10565 is merged