Add Fast404PathTestCase for testing paths fast404_path_check

Comments

naveenvalecha created an issue. See original summary.

naveenvalecha’s picture

Status: Active » Needs review
Parent issue: » #2715027: Fast 404 8.x-2.x-beta1
StatusFileSize
new2.35 KB

Attached patch would work but the fast404 is not sending the fast404 output in the case of the paths.this might be proably due to the Event Subscriber weight but not sure about that.

naveenvalecha’s picture

Status: Needs review » Needs work

The patch N/W as per #2

gg4’s picture

+++ b/tests/src/Functional/Fast404PathTestCase.php
@@ -0,0 +1,64 @@
+//    $this->assertRaw('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "/notdrupal" was not found on this server.</p></body></html>');

Why is this commented out?

damienmckenna’s picture

I suspect the problem may be that adding some values in Settings may not make it available to the entire system. Certainly this line seems irrelevant:

new Settings($settings + Settings::getAll());

I would suggest start with looking into core's KeyValue system, see how to store settings there.

(BICBW)

gg4’s picture

I think there is probably a better way to handle settings in these tests in general. I am really meaning to get to adding test coverage for this module so we can get to a stable release.

gg4’s picture

+++ b/tests/src/Functional/Fast404PathTestCase.php
@@ -0,0 +1,64 @@
+    new Settings($settings + Settings::getAll());

but, yea, this should probably just be:

$settings = Settings::getAll();
$settings['fast404_path_check'] = TRUE;
$settings['fast404_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
new Settings($settings);
robpowell’s picture

StatusFileSize
new2.33 KB
new2.18 KB

Couldn't get phpunit running reliably locally, going to get the test bot to hit this.

robpowell’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: fast404-2715585-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

gg4’s picture

Status: Needs work » Needs review
StatusFileSize
new2.13 KB

Status: Needs review » Needs work

The last submitted patch, 11: fast404-2715585-11.patch, failed testing. View results

gg4’s picture

Status: Needs work » Needs review
StatusFileSize
new799 bytes
new2.04 KB

  • bonus committed 0cf2cf5 on 8.x-1.x
    Issue #2715585 by bonus, robpowell, naveenvalecha: Add...
gg4’s picture

Status: Needs review » Fixed

PageCacheTest has some good examples of how to handle settings in functional tests.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.