Test Failed
Push — master ( 516706...5e6182 )
by ANDRE
02:37
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
use Simple_Featured_Image_Column;
9
10
/**
11
 * Class that tests the simple featured image column
12
 */
13
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...
14
15
/**
16
 * The ID of this plugin.
17
 *
18
 * @since    1.0.8
19
 * @access   private
20
 * @var      string    $plugin_name    The ID of this plugin.
21
 */
22
	private $plugin_name = 'simple-featured-image-column';
23
	
24
/**
25
 * The version of this plugin.
26
 *
27
 * @since    1.0.8
28
 * @access   private
29
 * @var      string    $version    The current version of this plugin.
30
 */
31
	private $version = '1.0.8';
32
	
33
	function setUp() {
34
		parent::setUp();
35
		$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...
36
	}
37
	
38
/**
39
 * Test the columns method
40
 *
41
 * Test if the method columns exists.
42
 *
43
 * @since 1.0.8
44
 */
45
  public function test_method_type() {
46
    $columns = new Simple_Featured_Image_Column( $this->plugin_name, $this->version );
0 ignored issues
show
Unused Code introduced by
The call to Simple_Featured_Image_Column::__construct() has too many arguments starting with $this->plugin_name. ( Ignorable by Annotation )

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

46
    $columns = /** @scrutinizer ignore-call */ new Simple_Featured_Image_Column( $this->plugin_name, $this->version );

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
47
    $this->assertTrue( method_exists( $columns , 'columns' ) );
48
  }
49
}
50