1 | <?php |
||
15 | class WP_Test_Jetpack_Pre_Connection_JITMs extends TestCase { |
||
16 | |||
17 | /** |
||
18 | * Tests the Jetpack_Pre_Connection_JITMs::add_pre_connection_jitms method with different |
||
19 | * published post counts. |
||
20 | * |
||
21 | * @param int $posts_count The number of published posts. |
||
22 | * @param int $expected_jitms_count The expected number of JITMs that should be returned by |
||
23 | * Jetpack_Pre_Connection_JITMs::add_pre_connection_jitms. |
||
24 | * |
||
25 | * @dataProvider data_provider_test_add_pre_connection_jitms |
||
26 | */ |
||
27 | public function test_add_pre_connection_jitms( $posts_count, $expected_jitms_count ) { |
||
40 | |||
41 | /** |
||
42 | * Data provider for the test_add_pre_connection_jitms test method. |
||
43 | * |
||
44 | * Jetpack has three pre-connection JITMs. One JITM, jpsetup-posts, is only displayed |
||
45 | * when the number of published posts is greater than or equal to five. |
||
46 | * |
||
47 | * @return array An array of test data. |
||
48 | */ |
||
49 | public function data_provider_test_add_pre_connection_jitms() { |
||
57 | |||
58 | /** |
||
59 | * Verify that the pre-connection JITM button link ends with the expected query. |
||
60 | */ |
||
61 | public function test_add_pre_connection_jitms_button_link() { |
||
73 | |||
74 | /** |
||
75 | * Tests the add_pre_connection_jitms method when the input to the method is |
||
76 | * an array containing a single JITM. The three Jetpack pre-connection JITMs |
||
77 | * and the additional test JITM should be returned. |
||
78 | */ |
||
79 | public function test_add_pre_connection_jitms_existing_jitms() { |
||
104 | |||
105 | /** |
||
106 | * Tests the add_pre_connection_jitms method when the input to the method is |
||
107 | * not an array. The three Jetpack pre-connection JITMs should |
||
108 | * be returned. |
||
109 | */ |
||
110 | public function test_add_pre_connection_jitms_not_an_array() { |
||
124 | } |
||
125 |
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: