Skip to content

Commit

Permalink
Fixing tests for changed SCRIPT_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndkauboy committed May 7, 2024
1 parent 230bbcd commit 899df20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Unit/AntispamBeeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function test_gets_ip_address() {
$_SERVER['REMOTE_ADDR'] = '192.0.2.1';
$_SERVER['HTTP_X_FORWARDED_FOR'] = '192.0.2.2, 10.0.0.10';
$_SERVER['HTTP_X_REAL_IP'] = 'bogus';
$_SERVER['REQUEST_URI'] = 'https://domain.com/wp-comments-post.php';
$_SERVER['SCRIPT_NAME'] = '/wp-comments-post.php';
$_POST['comment'] = $comment;

$result = Testee::handle_incoming_request( $comment );
Expand Down Expand Up @@ -99,7 +99,7 @@ public function test_spam_reasons( $comment, $reason ) {
$comment = array_merge( $this->get_base_comment(), $comment );

$_SERVER['REMOTE_ADDR'] = '12.23.34.45';
$_SERVER['REQUEST_URI'] = 'https://domain.com/wp-comments-post.php';
$_SERVER['SCRIPT_NAME'] = '/wp-comments-post.php';
$_POST['comment'] = $comment;

// This is where we check for the spam reason that was detected.
Expand Down

0 comments on commit 899df20

Please sign in to comment.