Failed Conditions
Push — develop ( 6d7133...7e9fe5 )
by Reüel
04:49 queued 26s
created

_manually_load_plugin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Bootstrap tests
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2020 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Nocks
9
 */
10
11
putenv( 'WP_PHPUNIT__TESTS_CONFIG=tests/wp-config.php' );
12
13
require_once __DIR__ . '/../vendor/autoload.php';
14
15
require_once getenv( 'WP_PHPUNIT__DIR' ) . '/includes/functions.php';
16
17
/**
18
 * Manually load plugin.
19
 */
20
function _manually_load_plugin() {
21
	global $pronamic_ideal;
22
23
	$pronamic_ideal = pronamic_pay_plugin();
24
}
25
26
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
0 ignored issues
show
Bug introduced by
'_manually_load_plugin' of type string is incompatible with the type array|object expected by parameter $function_to_add of tests_add_filter(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

26
tests_add_filter( 'muplugins_loaded', /** @scrutinizer ignore-type */ '_manually_load_plugin' );
Loading history...
27
28
// Bootstrap.
29
require getenv( 'WP_PHPUNIT__DIR' ) . '/includes/bootstrap.php';
30