-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
register_block_type
: Accept editor_script
array for back-compat
#3487
register_block_type
: Accept editor_script
array for back-compat
#3487
Conversation
44c2547
to
15dbfb7
Compare
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.
There is one edge case to address that I explained in https://github.com/WordPress/wordpress-develop/pull/3487/files#r999249106. Otherwise, it's looking good in terms of covering the legacy undocumented behavior. Nice team work on the patch 💯
I've added unit test coverage for the issue discussed in the conversation starting at #3487 (comment). They're expected to fail until we settle on a resolution (see #3487 (comment)). |
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.
Excellent work. Thank you addressing all my feedback. It wasn’t simple to tackle with different constraints in the REST API and in how the block type was handled in the past. In my eyes, it’s ready to land.
Trying to draft a commit message:
|
f53fc2f
to
7c1c7f7
Compare
Co-authored-by: Jonny Harris <[email protected]>
$this->assertSame( 'hello', $data['editor_script'] ); | ||
$this->assertSame( 'gutenberg', $data['script'] ); | ||
$this->assertSame( 'foo', $data['view_script'] ); | ||
$this->assertSame( 'guten', $data['editor_style'] ); | ||
$this->assertSame( 'out', $data['style'] ); |
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.
Test methods with multiple assertions need a message
parameter for each assertion, per Core Handbook - Writing PHPUnit Tests - Using Assertions.
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.
Addressed in 9bc56a5 😊
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.
Looks good to me 👍
Thank you very much, @SergeyBiryukov! 🎉 (I think your approval just coincided with my 9bc56a5 which I pushed to address #3487 (comment) -- not sure you saw that commit 😅 ) |
Looks even better now 😄 |
src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
Outdated
Show resolved
Hide resolved
…rties Co-authored-by: Jonny Harris <[email protected]>
…rties, pt. 2 Co-authored-by: Jonny Harris <[email protected]>
Co-authored-by: Jonny Harris <[email protected]>
There's some coding standards issues to fix though :) |
Based on prior work by @nendeb and @costdev in 56707. Quoting that ticket:
Props @nendeb @costdev @gziolo
TODO
Ideally test setter separately from getterProbably okay as-is; they're two faces of the same medal.Trac ticket: https://core.trac.wordpress.org/ticket/56707
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.