Follow-up to feature #14277: Fixed unit tests for loading scriptaculous modules
authorOliver Hader <oliver.hader@typo3.org>
Tue, 8 Jun 2010 12:47:41 +0000 (12:47 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 8 Jun 2010 12:47:41 +0000 (12:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7836 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
tests/t3lib/t3lib_pagerenderer_testcase.php

index 09f1790..1b68c24 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Cleanup: Fixed formatting of t3lib_PageRenderer_testcase
        * Follow-up to bug #3977: Unit tests for directory permission are too restrictive
 
        * Cleanup: Fixed formatting of t3lib_PageRenderer_testcase
        * Follow-up to bug #3977: Unit tests for directory permission are too restrictive
+       * Follow-up to feature #14277: Fixed unit tests for loading scriptaculous modules
 
 2010-06-08  Steffen Kamper  <info@sk-typo3.de>
 
 
 2010-06-08  Steffen Kamper  <info@sk-typo3.de>
 
index 0732d0d..89cbc62 100644 (file)
@@ -407,13 +407,51 @@ class t3lib_PageRenderer_testcase extends tx_phpunit_testcase {
         *
         */
        public function testLoadScriptaculous() {
         *
         */
        public function testLoadScriptaculous() {
+               $this->fixture->loadScriptaculous('slider,controls');
+               $out = $this->fixture->render();
+
+               $this->assertContains(
+                       '<script src="contrib/scriptaculous/scriptaculous.js" type="text/javascript"></script>',
+                       $out
+               );
+               $this->assertContains(
+                       '<script src="contrib/scriptaculous/effects.js" type="text/javascript"></script>',
+                       $out
+               );
+               $this->assertContains(
+                       '<script src="contrib/scriptaculous/controls.js" type="text/javascript"></script>',
+                       $out
+               );
+               $this->assertContains(
+                       '<script src="contrib/scriptaculous/slider.js" type="text/javascript"></script>',
+                       $out
+               );
+       }
 
 
-               $expectedRegExp = '#<script src="contrib/scriptaculous/scriptaculous\.js\?load=effects,controls,slider(&\d+)?" type="text/javascript"></script>#';
+       /**
+        * Tests whether scriptaculous is loaded correctly when compression is enabled.
+        *
+        * @test
+        */
+       public function isScriptaculousLoadedCompressed() {
                $this->fixture->loadScriptaculous('slider,controls');
                $this->fixture->loadScriptaculous('slider,controls');
+               $this->fixture->enableCompressJavascript();
                $out = $this->fixture->render();
 
                $this->assertRegExp(
                $out = $this->fixture->render();
 
                $this->assertRegExp(
-                       $expectedRegExp,
+                       '#<script src="[^"]*/typo3temp/compressor/scriptaculous-[a-f0-9]+.js" type="text/javascript"></script>#',
+                       $out
+               );
+               $this->assertRegExp(
+                       '#<script src="[^"]*/typo3temp/compressor/effects-[a-f0-9]+.js" type="text/javascript"></script>#',
+                       $out
+               );
+               $this->assertRegExp(
+                       '#<script src="[^"]*/typo3temp/compressor/controls-[a-f0-9]+.js" type="text/javascript"></script>#',
+                       $out
+               );
+               $this->assertRegExp(
+                       '#<script src="[^"]*/typo3temp/compressor/slider-[a-f0-9]+.js" type="text/javascript"></script>#',
                        $out
                );
        }
                        $out
                );
        }