[wp-trac] [WordPress Trac] #45097: Introduce WP_Block_Type and WP_Block_Type_Registry classes

WordPress Trac noreply at wordpress.org
Wed Oct 17 11:52:12 UTC 2018


#45097: Introduce WP_Block_Type and WP_Block_Type_Registry classes
------------------------------------------+-----------------------
 Reporter:  danielbachhuber               |       Owner:  desrosj
     Type:  task (blessed)                |      Status:  assigned
 Priority:  normal                        |   Milestone:  5.0
Component:  REST API                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  rest-api
------------------------------------------+-----------------------

Comment (by danielbachhuber):

 In `45097.2.diff`, further [https://github.com/WordPress/wordpress-
 develop/pull/20 adaptation] of the patch:

 * Updates `@since` to `5.0.0`.
 * Updates `@package` to `WordPress` and `@subpackage` to `Blocks`.
 * Removes `'gutenberg'` textdomain.
 * Renames unit test files according to existing standards.

 @adamsilverstein I'm not sure why the tests are passing in Travis for you.
 Locally, I get:

 {{{
 1) WP_Test_Block_Type_Registry::test_register_block_type_instance
 Error: Class 'WP_Dummy_Block_Type' not found

 /Users/danielbachhuber/projects/wordpress-
 develop/tests/phpunit/tests/blocks/block-type-registry.php:111

 2) WP_Test_Block_Type::test_has_block_with_mixed_content
 Error: Call to undefined function has_block()

 /Users/danielbachhuber/projects/wordpress-
 develop/tests/phpunit/tests/blocks/block-type.php:195

 3) WP_Test_Block_Type::test_has_block_with_invalid_content
 Error: Call to undefined function has_block()

 /Users/danielbachhuber/projects/wordpress-
 develop/tests/phpunit/tests/blocks/block-type.php:224

 4) WP_Test_Block_Type::test_post_has_block
 Error: Call to undefined function has_block()

 /Users/danielbachhuber/projects/wordpress-
 develop/tests/phpunit/tests/blocks/block-type.php:237
 }}}

 It seems like we'll need to wait for `has_block` to land (#45065 I think)
 before we can continue with this.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45097#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list