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
Renato Alves 13e73bc821 Update all references from wp_parse_args to bp_parse_args.
Also, add WPCS improvements to align `bp_parse_args` correctly.

Props imath
Fixes #8564

git-svn-id: https://buddypress.svn.wordpress.org/trunk@13108 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2021-09-12 20:43:39 +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 = bp_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 );
}
}