tester->grabFromDatabase('php_testing_rule', 'testing_rule', [ 'testing_name' => 'testing_number_one' ]); // Process expected HTML and response for comparison $test = str_replace(["\r\n", "\r", "\n", " "], "", $row); $result_test = htmlspecialchars($test); $result_content = str_replace(["\r\n", "\r", "\n", " "], "", $responseContent); // Assert that expected content exists in the response $this->assertStringContainsString($result_test, $result_content); } public function testUploadedFileContainsSession() { $fileContent = file_get_contents('http://127.0.0.1:8000/phpunit/result-test-student/'); $this->assertStringContainsString('session_start()', $fileContent, 'File tidak mengandung session_start()'); $this->assertMatchesRegularExpression('/\$_SESSION\s*\[.*\]/', $fileContent, 'File tidak mengandung manipulasi $_SESSION'); } public function testUploadedFileContainsFormHandling() { // Ambil isi file dari URL $fileContent = file_get_contents('http://127.0.0.1:8000/phpunit/result-test-student/'); $fileContent = htmlspecialchars_decode($fileContent); $this->assertMatchesRegularExpression('/\$_POST\s*\[.*\]/', $fileContent, 'File tidak mengandung pengelolaan form dengan POST'); $this->assertMatchesRegularExpression('/\$_GET\s*\[.*\]/', $fileContent, 'File tidak mengandung pengelolaan form dengan GET'); $this->assertMatchesRegularExpression('/