From 5614941d14a9db50bdeabc4273b02b2559d97508 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Tue, 23 Jan 2024 15:39:02 +0545 Subject: [PATCH] Update localhost tests to show multiple errors --- .../tests/Checker/Checks/Localhost_Check_Tests.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/Checker/Checks/Localhost_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/Localhost_Check_Tests.php index 5dd710de4..729661288 100644 --- a/tests/phpunit/tests/Checker/Checks/Localhost_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/Localhost_Check_Tests.php @@ -22,11 +22,17 @@ public function test_run_with_errors() { $this->assertNotEmpty( $errors ); $this->assertArrayHasKey( 'load.php', $errors ); - $this->assertEquals( 1, $check_result->get_error_count() ); + $this->assertArrayHasKey( 'another.php', $errors ); + $this->assertEquals( 2, $check_result->get_error_count() ); $this->assertArrayHasKey( 0, $errors['load.php'] ); $this->assertArrayHasKey( 0, $errors['load.php'][0] ); $this->assertArrayHasKey( 'code', $errors['load.php'][0][0][0] ); $this->assertEquals( 'localhost_code_detected', $errors['load.php'][0][0][0]['code'] ); + + $this->assertArrayHasKey( 0, $errors['another.php'] ); + $this->assertArrayHasKey( 0, $errors['another.php'][0] ); + $this->assertArrayHasKey( 'code', $errors['another.php'][0][0][0] ); + $this->assertEquals( 'localhost_code_detected', $errors['another.php'][0][0][0]['code'] ); } }