-
Notifications
You must be signed in to change notification settings - Fork 28
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
FIX Use get_one_by_stage when fetching SiteTree for a specific stage #52
FIX Use get_one_by_stage when fetching SiteTree for a specific stage #52
Conversation
protected static $fixture_file = 'HistoryControllerFactoryTest.yml'; | ||
|
||
protected static $illegal_extensions = [ | ||
HistoryControllerFactory::class => ['DNADesign\Elemental\Extensions\HistoryControllerFactoryExtension'] |
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 think we should just remove every extension on this rather than individual ones. Other modules could have interfered with this as well, we ideally want to clear the global state and isolate it with your stub extension below right?
protected static $illegal_extensions = [
HistoryControllerFactory::class => '*',
];
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.
Ideally yes - all extensions are bad but the TestOnly
one. I didn't even know that you could use '*'
.
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace SilverStripe\AssetAdmin\Tests\Controller\HistoryControllerFactory; |
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.
The package name is wrong
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.
🤦♂️
{ | ||
public function updateIsEnabled($record) | ||
{ | ||
return $record->Title === '2'; |
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.
Can you add a comment that this is referring to HistoryControllerFactoryTest.yml fixtures?
44bd485
to
45b4980
Compare
45b4980
to
6be253c
Compare
Made the suggested changes 🙂 |
I had trouble reproducing this using the steps that @Cheddam provided but I managed to reproduce it consistently with a test (that I've added to this commit). Yay for TDD!
Resolves #51