From 65800af95eb8e4502bdbcda3e9c32ad01f1058aa Mon Sep 17 00:00:00 2001 From: redrun Date: Sun, 15 Jun 2025 19:40:58 -0500 Subject: [PATCH 1/2] Fix undefined variables in advanced_search --- .../views/catalog/partials/advanced_search.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/views/catalog/partials/advanced_search.php b/application/views/catalog/partials/advanced_search.php index 0c04866b..526b7757 100644 --- a/application/views/catalog/partials/advanced_search.php +++ b/application/views/catalog/partials/advanced_search.php @@ -1,5 +1,5 @@ - + @@ -17,7 +17,7 @@
@@ -25,7 +25,7 @@
@@ -33,7 +33,7 @@
@@ -58,7 +58,7 @@
@@ -66,7 +66,7 @@
@@ -74,7 +74,7 @@
@@ -82,7 +82,7 @@
@@ -90,7 +90,7 @@
From 2af677c6f381ff7c1b0019eb2abe88f61d276d4a Mon Sep 17 00:00:00 2001 From: redrun Date: Mon, 9 Jun 2025 21:33:27 -0500 Subject: [PATCH 2/2] Add basic tests for catalog Page view Checks for some strings that are least likely ever to change in the live database --- .../tests/controllers/catalog/Page_test.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 application/tests/controllers/catalog/Page_test.php diff --git a/application/tests/controllers/catalog/Page_test.php b/application/tests/controllers/catalog/Page_test.php new file mode 100644 index 00000000..81d71e6a --- /dev/null +++ b/application/tests/controllers/catalog/Page_test.php @@ -0,0 +1,54 @@ +request('GET', array('Page', 'index', $url)); + foreach ($expected as $str) { + $this->assertStringContainsString($str, $response); + } + } + + public static function provider() + { + return array( + + // A simple test case with single-quote in title + array( + 'url' => 'doctors-red-lamp-by-various', + 'expected' => array( + 'The Doctor\'s Red Lamp | LibriVox', // HTML title + '', // Book Coordinator + '', // Meta-Coordinator + '', // Proof-Listener + '', // Source text + '', // Author + 'doctorsredlamp_27_moulton_64kb.mp3', // Last audio (64kb) + 'doctorsredlamp_27_moulton_128kb.mp3', // Last audio (128kb) + ) + ), + + // Double-quote in title, single in description + array( + 'url' => 'boy-the-wandering-dog-by-marshall-saunders', + 'expected' => array( + '"Boy" The Wandering Dog | LibriVox', // HTML title + '', // Book Coordinator + '', // Meta-Coordinator + '', // Proof-Listener + '', // Source text + '