1
0
Fork 0
mirror of https://github.com/buddypress/buddypress.git synced 2026-07-22 20:56:55 +08:00
buddypress/tests/phpunit/assets/class-bptest-component.php
Mathieu Viet f37839af01 Introduce a new BP_Component property for block globals
This new property will help us to manage Widget Block occurrences globals and use a single filter on `'widget_block_dynamic_classname'` to make sure Widget Blocks will include Legacy Widget classnames and inherit their styles.

This commit also makes sure WordPress is >= 5.0 before using the `has_block` function.

See #8515
Fixes #8516



git-svn-id: https://buddypress.svn.wordpress.org/trunk@12998 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2021-07-14 08:52:00 +00:00

37 lines
644 B
PHP

<?php
// Testing Component Class.
class BPTest_Component extends BP_Component {
/**
* Globals to test.
*
* @var array
*/
public $globals = array();
// Start the `test` component setup process.
public function __construct( $args = array() ) {
$r = wp_parse_args(
$args,
array(
'id' => 'example',
'name' => 'Example Component',
'globals' => array(
'slug' => 'example',
),
)
);
$this->globals = $r['globals'];
parent::start(
$r['id'],
$r['name']
);
}
// Setup Test Globals.
public function setup_globals( $args = array() ) {
parent::setup_globals( $this->globals );
}
}