Skip to content

Commit

Permalink
Update localhost tests to show multiple errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Jan 23, 2024
1 parent cd39b7f commit 5614941
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/phpunit/tests/Checker/Checks/Localhost_Check_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] );
}
}

0 comments on commit 5614941

Please sign in to comment.