@@ -39,6 +39,22 @@ 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+ // print_r( $errors );
44+
45+ // Non singular string literal errors.
46+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][40 ][10 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralSingle ' ) ) );
47+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][40 ][10 ][0 ]['severity ' ] );
48+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][40 ][19 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralPlural ' ) ) );
49+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][40 ][19 ][0 ]['severity ' ] );
50+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][41 ][15 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralSingular ' ) ) );
51+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][41 ][15 ][0 ]['severity ' ] );
52+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][41 ][24 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralPlural ' ) ) );
53+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][41 ][24 ][0 ]['severity ' ] );
54+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][42 ][10 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralText ' ) ) );
55+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][42 ][10 ][0 ]['severity ' ] );
56+ $ this ->assertCount ( 1 , wp_list_filter ( $ errors ['load.php ' ][42 ][17 ], array ( 'code ' => 'WordPress.WP.I18n.NonSingularStringLiteralContext ' ) ) );
57+ $ this ->assertSame ( 7 , $ errors ['load.php ' ][42 ][17 ][0 ]['severity ' ] );
4258 }
4359
4460 public function test_run_without_errors () {
0 commit comments