-
Notifications
You must be signed in to change notification settings - Fork 334
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
BUG Remove broken RESOURCES_DIR test #2599
BUG Remove broken RESOURCES_DIR test #2599
Conversation
How do we prevent the use of underscores? And why do we prevent that? Wouldn't someone be able to change the URL substitutions so that underscores are used instead of hyphens? |
Just double checked in SS45 and the CMS won't let me create a page called |
I think that might be the thing that broke it silverstripe/silverstripe-framework#9064 |
Actually, the "problem" is the new DataObject hydration logic. silverstripe/silverstripe-framework#8591 My test was abusing the DataObject constructor to initialise the URLSegment. This was also setting the original values on the DataObject which caused Sam's PR makes my dodgy constructor call actually work in a sensible way ... which breaks the test. Since the situation I was testing for can not happen in practice, I think removing the test is the right thing to do. |
What happens if Plenty of existing sites will still have the old fashioned 'resources' directory in play |
That scenario is handle just below the test I'm deleting. That is the default value. If you start a new project from the installer the default your resource dir is overridden to |
if (RESOURCES_DIR !== 'resources') {
$this->markTestSkipped('This legacy test requires RESOURCES_DIR to be "resources"');
} Just need to confirm that this test isn't going to get skipped
So to confirm, 'resources' is the default value of RESOURCES_DIR? Or is it '_resources' (which is what I would expect) ? |
When SS4.0 was released, vendor-expose would put static assets in Because RESOURCES_DIR get defined the project is bootstrapped, there's no way to changed the value dynamically in the tests.
|
@maxime-rainville OK sounds good, could you put an inline comment within the unit tests file. All good if you just copy paste your last comment straight in |
5d8e342
to
aaf4fb4
Compare
Done |
That test is no longer needed because we won't allow you to save a page with an underscore in its URLSegment.
This should fix the broken recipe-cms build and some of the sink build.