wp-cli-secure-command/tests/Feature/Nginx/BlockAuthorScanningTest.php
2022-04-11 11:40:58 +02:00

22 lines
No EOL
712 B
PHP

<?php
namespace Tests\Feature;
use Tests\BaseTestCase;
use WP_CLI_Secure\SubCommands\BlockAuthorScanning;
class BlockAuthorScanningTest extends BaseTestCase {
public function setUp(): void {
parent::setUp();
$command = new BlockAuthorScanning($this->apacheAssocArgs);
$command->output();
exec('cd ' . getcwd() . DIRECTORY_SEPARATOR . $_ENV['WORDPRESS_NGINX_PATH'] . '&& ddev exec nginx -s reload');
}
public function testItWillReturnHttp403OnApacheWhenAccessingPhpFilesInWpIncludesDirectory() : void {
$response = $this->apacheHttpClient->get('/?author=12', ['http_errors' => false]);
$this->assertEquals(403, $response->getStatusCode());
}
}