-
Notifications
You must be signed in to change notification settings - Fork 0
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
Script Loading Strategy - Update standalone business logic #47
Script Loading Strategy - Update standalone business logic #47
Conversation
…cement/update-wp-add-inline-script-standalone
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
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.
@kt-12 minor feedback, mostly grammatical and one or two smaller observations.
$this->assertSame( $expected, $output, $message ); | ||
} | ||
|
||
public function data_standalone_inline_script() { |
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.
Missing docblock, I know it's a data provider for the test but we should still have docblocks or not?
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.
Same comment about the use of a data provider here.
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.
As mentioned above this will be handled in PR #50.
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
Co-authored-by: Simon Dowdles <72872375+10upsimon@users.noreply.github.com>
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.
@kt-12 this is looking good. I am approving as I did not see the missing docblocks for test data providers as a total blocker, but if you can add them that would be great!
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 functionality here looks good, I left some feedback about the use of data providers in this context, which I think we should adjust either here or in a following PR if needed.
To address your questions about adding doc blocks, I think that even though there are several places in the current WordPress unit tests where those don't exist, I would prefer us put in the extra effort to put some doc blocks in place on data providers wherever we are using them.
$this->assertSame( $expected, $output, $message ); | ||
} | ||
|
||
public function data_non_standalone_before_inline_script_with_defer() { |
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.
Generally speaking, data providers are meant to provide inputs into whatever functionality you are unit testing, and not just passing parameters to a PHPUnit assertion. I think that these would probably be better broken up into several individual tests instead.
$this->assertSame( $expected, $output, $message ); | ||
} | ||
|
||
public function data_standalone_inline_script() { |
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.
Same comment about the use of a data provider here.
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.
Fixes #17
Trac ticket:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.