1 | <?php //phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
||
16 | class Password_Checker_Test extends BaseTestCase { |
||
17 | /** |
||
18 | * User ID. |
||
19 | * |
||
20 | * @var int|\WP_Error |
||
21 | */ |
||
22 | private $user_id; |
||
23 | |||
24 | /** |
||
25 | * User object. |
||
26 | * |
||
27 | * @var \WP_User |
||
28 | */ |
||
29 | private $user; |
||
30 | |||
31 | /** |
||
32 | * Password_Checker object. |
||
33 | * |
||
34 | * @var Password_Checker |
||
35 | */ |
||
36 | private $password_checker; |
||
37 | |||
38 | /** |
||
39 | * Initialize tests. |
||
40 | * |
||
41 | * @before |
||
42 | */ |
||
43 | public function set_up() { |
||
59 | |||
60 | /** |
||
61 | * Test the password checker. |
||
62 | * |
||
63 | * @dataProvider rule_provider |
||
64 | * |
||
65 | * @param string $section Section name. |
||
66 | * @param string $rule Rule name. |
||
67 | * @param string $password The password. |
||
68 | * @param bool $expected_result The expected result. |
||
69 | * @param string $output_message The output message. |
||
70 | */ |
||
71 | public function test_password( $section, $rule, $password, $expected_result, $output_message ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
80 | |||
81 | /** |
||
82 | * Data provider for password tests. |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | public function rule_provider() { |
||
156 | } |
||
157 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: