Make WordPress Core

Changeset 47876


Ignore:
Timestamp:
06/01/2020 04:25:18 PM (5 years ago)
Author:
ocean90
Message:

Editor: Fix code style for constructor arguments added in [47875].

Also revert unintended changes to WP_Block_Type::__construct() DocBlock.

See #48529.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-type.php

    r47875 r47876  
    138138     * Will populate object properties from the provided arguments.
    139139     *
     140     * @since 5.0.0
     141     *
     142     * @see register_block_type()
     143     *
    140144     * @param string       $block_type Block type name including namespace.
    141145     * @param array|string $args       Optional. Array or string of arguments for registering a block type.
    142146     *                                 Default empty array.
    143      *
    144      * @since 5.0.0
    145      *
    146      * @see   register_block_type()
    147      *
    148147     */
    149148    public function __construct( $block_type, $args = array() ) {
  • trunk/tests/phpunit/tests/admin/includesPost.php

    r47875 r47876  
    838838
    839839        $this->assertArrayHasKey( $name, $blocks );
    840         $this->assertEquals( array(
    841             'title'       => '',
    842             'description' => '',
    843             'category'    => 'common',
    844             'icon'        => 'text',
    845             'keywords'    => array(),
    846             'supports'    => array(),
    847             'styles'      => array(),
    848         ), $blocks[ $name ] );
     840        $this->assertEquals(
     841            array(
     842                'title'       => '',
     843                'description' => '',
     844                'category'    => 'common',
     845                'icon'        => 'text',
     846                'keywords'    => array(),
     847                'supports'    => array(),
     848                'styles'      => array(),
     849            ),
     850            $blocks[ $name ]
     851        );
    849852    }
    850853
  • trunk/tests/phpunit/tests/blocks/block-type.php

    r47875 r47876  
    354354     */
    355355    public function test_register_block() {
    356         $block_type = new WP_Block_Type( 'core/fake', array(
    357             'title'       => 'Test title',
    358             'category'    => 'Test category',
    359             'parent'      => array( 'core/third-party' ),
    360             'icon'        => 'icon.png',
    361             'description' => 'test description',
    362             'keywords'    => array( 'test keyword' ),
    363             'textdomain'  => 'test_domain',
    364             'supports'    => array( 'alignment' => true ),
    365         ) );
     356        $block_type = new WP_Block_Type(
     357            'core/fake',
     358            array(
     359                'title'       => 'Test title',
     360                'category'    => 'Test category',
     361                'parent'      => array( 'core/third-party' ),
     362                'icon'        => 'icon.png',
     363                'description' => 'test description',
     364                'keywords'    => array( 'test keyword' ),
     365                'textdomain'  => 'test_domain',
     366                'supports'    => array( 'alignment' => true ),
     367            )
     368        );
    366369
    367370        $this->assertSame( 'Test title', $block_type->title );
Note: See TracChangeset for help on using the changeset viewer.