Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 259613f

Browse files
committed
Update test for 3.1.28 master
1 parent 0669a77 commit 259613f

File tree

6 files changed

+28
-27
lines changed

6 files changed

+28
-27
lines changed

PHPUnit_Smarty.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
include_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.

UnitTests/A_Core/Filter/FilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testAutoloadVariableFilter()
5252
public function testLoadedOutputFilter()
5353
{
5454
$this->smarty->loadFilter(Smarty::FILTER_OUTPUT, 'trimwhitespace');
55-
$tpl = $this->smarty->createTemplate('eval:{" <br>hello world"}');
55+
$tpl = $this->smarty->createTemplate('string:{" <br>hello world"}');
5656
$this->assertEquals("<br>hello world", $this->smarty->fetch($tpl));
5757
}
5858

UnitTests/A_Core/LoadPlugin/IncludePathTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @package PHPunit
77
* @author Rodney Rehm
8-
* @runTestsInSeparateProcess
8+
* @run TestsInSeparateProcess
99
* @preserveGlobalState disabled
1010
* @backupStaticAttributes enabled
1111
*/

UnitTests/CacheResourceTests/_shared/CacheResourceTestCommon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function doClearCacheAssertion($a, $b)
3030

3131
public function compiledPrefilter($text, Smarty_Internal_Template $tpl)
3232
{
33-
return str_replace('#', $tpl->_getVariable('test'), $text);
33+
return str_replace('#', $tpl->getTemplateVars('test'), $text);
3434
}
3535

3636
/**

UnitTests/ResourceTests/Extends/ExtendsResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testInit()
2828

2929
public function compiledPrefilter($text, Smarty_Internal_Template $tpl)
3030
{
31-
return str_replace('#', $tpl->_getVariable('test'), $text);
31+
return str_replace('#', $tpl->getTemplateVars('test'), $text);
3232
}
3333

3434
/**

UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function setUp()
2323

2424
public function compiledPrefilter($text, Smarty_Internal_Template $tpl)
2525
{
26-
return str_replace('#', $tpl->_getVariable('test'), $text);
26+
return str_replace('#', $tpl->getTemplateVars('test'), $text);
2727
}
2828

2929
public function testInit()
@@ -633,6 +633,7 @@ public function testSmartyBlockParentInParent_027()
633633

634634
/**
635635
* test child/parent template chain
636+
*
636637
* @runInSeparateProcess
637638
* @preserveGlobalState disabled
638639
* @dataProvider data

0 commit comments

Comments
 (0)