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 + ' + @@ -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 @@