55 */
66
77include_once __DIR__ . '/Config.php ' ;
8+
89/**
910 * Smarty Test Case Fixture
1011 */
@@ -71,10 +72,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase
7172 *
7273 * @var array
7374 */
74- protected $ backupStaticAttributesBlacklist = array (
75- 'PHPUnit_Smarty ' => array ('config ' , 'pdo ' , 'init ' ),
76- );
77-
75+ protected $ backupStaticAttributesBlacklist = array ('PHPUnit_Smarty ' => array ('config ' , 'pdo ' , 'init ' ),);
7876
7977 /**
8078 * This method is called before the first test of this test class is run.
@@ -84,7 +82,7 @@ public static function setUpBeforeClass()
8482 {
8583 error_reporting (E_ALL | E_STRICT );
8684 self ::$ init = true ;
87- }
85+ }
8886
8987 /**
9088 * This method is called after the last test of this test class is run.
@@ -322,7 +320,7 @@ public function buildSourcePath($tpl, $name = null, $type = null, $dir = null)
322320 case 'file ' :
323321 case 'filetest ' :
324322 case 'php ' :
325- return $ this ->normalizePath ($ dir . $ name );
323+ return $ this ->normalizePath ($ dir . $ name );
326324 case 'mysqltest ' :
327325 case 'mysql ' :
328326 return sha1 ($ type . ': ' . $ name );
@@ -371,17 +369,20 @@ public function buildUid($tpl, $value = null, $name = null, $type = null)
371369 * - remove /./ and /../
372370 * - make it absolute
373371 *
374- * @param string $path file path
372+ * @param string $path file path
375373 *
376374 * @return string
377375 */
378- public function normalizePath ($ path ) {
376+ public function normalizePath ($ path )
377+ {
379378 if ($ path [0 ] == '. ' ) {
380379 $ path = getcwd () . DS . $ path ;
381380 }
382381 $ path = preg_replace ('#[ \\\/]+([.][ \\\/]+)*# ' , DS , $ path );
383382 while (strrpos ($ path , '. ' . DS ) !== false ) {
384- $ path = preg_replace ('#([ \\\/]([^ \\\/]+[ \\\/]){2}([.][.][ \\\/]){2})|([ \\\/][^ \\\/]+[ \\\/][.][.][ \\\/])# ' , DS , $ path );
383+ $ path =
384+ preg_replace ('#([ \\\/]([^ \\\/]+[ \\\/]){2}([.][.][ \\\/]){2})|([ \\\/][^ \\\/]+[ \\\/][.][.][ \\\/])# ' , DS ,
385+ $ path );
385386 }
386387 return $ path ;
387388 }
@@ -430,26 +431,26 @@ public function getBasename(Smarty_Internal_Template $tpl, $name = null, $type =
430431 * @return string
431432 * @throws \Exception
432433 */
433- public function buildCompiledPath (Smarty_Internal_Template $ tpl , $ sub = true , $ caching = false , $ compile_id = null , $ name = null , $ type = null , $ dir = null )
434+ public function buildCompiledPath (Smarty_Internal_Template $ tpl , $ sub = true , $ caching = false , $ compile_id = null ,
435+ $ name = null , $ type = null , $ dir = null )
434436 {
435437 $ sep = DS ;
436438 $ _compile_id = isset ($ compile_id ) ? preg_replace ('![^\w\|]+! ' , '_ ' , $ compile_id ) : null ;
437439 $ sp = $ this ->buildSourcePath ($ tpl , $ name , $ type , $ dir );
438440 $ uid = $ this ->buildUid ($ tpl , $ sp , $ name , $ type );
439441 $ _flag = '' ;
440442 if (isset ($ tpl ->source ) && $ tpl ->source ->isConfig ) {
441- $ _flag = '_ ' . ((int ) $ tpl ->smarty ->config_read_hidden + (int ) $ tpl ->smarty ->config_booleanize * 2
442- + (int ) $ tpl ->smarty ->config_overwrite * 4 );
443+ $ _flag = '_ ' . ((int ) $ tpl ->smarty ->config_read_hidden + (int ) $ tpl ->smarty ->config_booleanize * 2 +
444+ (int ) $ tpl ->smarty ->config_overwrite * 4 );
443445 } else {
444446 $ _flag = '_ ' . ((int ) $ tpl ->smarty ->merge_compiled_includes + (int ) $ tpl ->smarty ->escape_html * 2 );
445447 }
446448 $ _filepath = $ uid . $ _flag ;
447449 // if use_sub_dirs, break file into directories
448450 if ($ sub ) {
449- $ _filepath = substr ($ _filepath , 0 , 2 ) . $ sep
450- . substr ($ _filepath , 2 , 2 ) . $ sep
451- . substr ($ _filepath , 4 , 2 ) . $ sep
452- . $ _filepath ;
451+ $ _filepath =
452+ substr ($ _filepath , 0 , 2 ) . $ sep . substr ($ _filepath , 2 , 2 ) . $ sep . substr ($ _filepath , 4 , 2 ) . $ sep .
453+ $ _filepath ;
453454 }
454455 $ _compile_dir_sep = $ sub ? $ sep : '^ ' ;
455456 if (isset ($ _compile_id )) {
@@ -490,7 +491,8 @@ public function buildCompiledPath(Smarty_Internal_Template $tpl, $sub = true, $c
490491 * @return string
491492 * @throws \Exception
492493 */
493- public function buildCachedPath ($ tpl , $ sub = true , $ cache_id = null , $ compile_id = null , $ name = null , $ type = null , $ dir = null , $ cacheType = null )
494+ public function buildCachedPath ($ tpl , $ sub = true , $ cache_id = null , $ compile_id = null , $ name = null , $ type = null ,
495+ $ dir = null , $ cacheType = null )
494496 {
495497 $ cacheType = isset ($ cacheType ) ? $ cacheType : $ tpl ->smarty ->caching_type ;
496498 switch ($ cacheType ) {
@@ -504,10 +506,9 @@ public function buildCachedPath($tpl, $sub = true, $cache_id = null, $compile_id
504506 $ _filepath = $ uid ;
505507 // if use_sub_dirs, break file into directories
506508 if ($ sub ) {
507- $ _filepath = substr ($ _filepath , 0 , 2 ) . $ sep
508- . substr ($ _filepath , 2 , 2 ) . $ sep
509- . substr ($ _filepath , 4 , 2 ) . $ sep
510- . $ _filepath ;
509+ $ _filepath =
510+ substr ($ _filepath , 0 , 2 ) . $ sep . substr ($ _filepath , 2 , 2 ) . $ sep . substr ($ _filepath , 4 , 2 ) .
511+ $ sep . $ _filepath ;
511512 }
512513 $ _compile_dir_sep = $ sub ? $ sep : '^ ' ;
513514 if (isset ($ _cache_id )) {
@@ -536,7 +537,6 @@ public function buildCachedPath($tpl, $sub = true, $cache_id = null, $compile_id
536537 }
537538 }
538539
539-
540540 /**
541541 * Tears down the fixture
542542 * This method is called after a test is executed.
0 commit comments