@@ -39,6 +39,36 @@ public function test_run_with_errors() {
3939 // Mismatched textdomain but not restricted and with severity 5.
4040 $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][36 ][29 ], array ( 'code ' => 'WordPress.WP.I18n.TextDomainMismatch ' ) ) );
4141 $ this ->assertSame ( 5 , $ errors ['load.php ' ][36 ][29 ][0 ]['severity ' ] );
42+
43+ // Non singular string literal errors.
44+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][40 ][10 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralSingle ' ) ) );
45+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][40 ][10 ][0 ]['severity ' ] );
46+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][40 ][19 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralPlural ' ) ) );
47+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][40 ][19 ][0 ]['severity ' ] );
48+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][41 ][15 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralSingular ' ) ) );
49+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][41 ][15 ][0 ]['severity ' ] );
50+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][41 ][24 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralPlural ' ) ) );
51+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][41 ][24 ][0 ]['severity ' ] );
52+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][42 ][10 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralText ' ) ) );
53+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][42 ][10 ][0 ]['severity ' ] );
54+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][42 ][17 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralContext ' ) ) );
55+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][42 ][17 ][0 ]['severity ' ] );
56+
57+ // Interpolated variable errors.
58+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][45 ][18 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariableText ' ) ) );
59+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][45 ][18 ][0 ]['severity ' ] );
60+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][46 ][10 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariableSingle ' ) ) );
61+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][46 ][10 ][0 ]['severity ' ] );
62+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][46 ][23 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariablePlural ' ) ) );
63+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][46 ][23 ][0 ]['severity ' ] );
64+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][47 ][15 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariableSingular ' ) ) );
65+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][47 ][15 ][0 ]['severity ' ] );
66+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][47 ][28 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariablePlural ' ) ) );
67+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][47 ][28 ][0 ]['severity ' ] );
68+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][48 ][10 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariableText ' ) ) );
69+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][48 ][10 ][0 ]['severity ' ] );
70+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][48 ][21 ], array ( 'code ' => 'WordPress.WP.I18n.InterpolatedVariableContext ' ) ) );
71+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][48 ][21 ][0 ]['severity ' ] );
4272 }
4373
4474 public function test_run_without_errors () {
0 commit comments