Test Failed
Push — master ( e1bc4d...0f9fae )
by ANDRE
02:28
created

Test_Simple_Column::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Class Test_Simple_Column.
4
 *
5
 * @package Simple_Featured_Image_Column
6
 */
7
8
/**
9
 * Class that tests the simple featured image column
10
 */
11
class Test_Simple_Column extends WP_UnitTestCase {
0 ignored issues
show
Bug introduced by
The type WP_UnitTestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
/**
14
 * The ID of this plugin.
15
 *
16
 * @since    1.0.8
17
 * @access   private
18
 * @var      string    $plugin_name    The ID of this plugin.
19
 */
20
	private $plugin_name = 'simple-featured-image-column';
0 ignored issues
show
introduced by
The private property $plugin_name is not used, and could be removed.
Loading history...
21
	
22
/**
23
 * The version of this plugin.
24
 *
25
 * @since    1.0.0
26
 * @access   private
27
 * @var      string    $version    The current version of this plugin.
28
 */
29
	private $version = '1.0.8';
0 ignored issues
show
introduced by
The private property $version is not used, and could be removed.
Loading history...
30
	
31
	function setUp() {
32
		parent::setUp();
33
		$this->sfic = new Simple_Featured_Image_Column;
0 ignored issues
show
Bug Best Practice introduced by
The property sfic does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
34
	}
35
	
36
	function create_post( $post = array() ) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
37
		$defaults = array(
38
			'post_title' => 'My Post',
39
			'post_content' => 'This is my post',
40
			'post_status' => 'publish',
41
			'post_author' => 1,
42
		);
43
		return wp_insert_post( array_merge( $defaults, $post ) );
0 ignored issues
show
Bug introduced by
The function wp_insert_post was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

43
		return /** @scrutinizer ignore-call */ wp_insert_post( array_merge( $defaults, $post ) );
Loading history...
44
	}
45
}
46