update $source->getContent()

This commit is contained in:
Uwe Tews
2015-07-01 16:57:50 +02:00
parent 5f8f92d75b
commit cb70b219ad
7 changed files with 10 additions and 10 deletions

View File

@@ -70,7 +70,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
$tpl = $this->smarty->createTemplate('foobar.tpl');
$this->assertTrue($tpl->source->exists);
$this->assertEquals('case1', $tpl->source->content);
$this->assertEquals('case1', $tpl->source->getContent());
}
/**
@@ -90,7 +90,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
$tpl = $this->smarty->createTemplate('foobar.tpl');
$this->assertTrue($tpl->source->exists);
$this->assertEquals('case2', $tpl->source->content);
$this->assertEquals('case2', $tpl->source->getContent());
}
/**
@@ -109,11 +109,11 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
$resource_handler->setSegment('case1');
$tpl = $this->smarty->createTemplate('foobar.tpl');
$this->assertTrue($tpl->source->exists);
$this->assertEquals('case1', $tpl->source->content);
$this->assertEquals('case1', $tpl->source->getContent());
$resource_handler->setSegment('case2');
$tpl = $this->smarty->createTemplate('foobar.tpl');
$this->assertTrue($tpl->source->exists);
$this->assertEquals('case2', $tpl->source->content);
$this->assertEquals('case2', $tpl->source->getContent());
}
}

View File

@@ -61,7 +61,7 @@ class EvalResourceTest extends PHPUnit_Smarty
public function testGetTemplateSource()
{
$tpl = $this->smarty->createTemplate('eval:hello world{$foo}');
$this->assertEquals('hello world{$foo}', $tpl->source->content);
$this->assertEquals('hello world{$foo}', $tpl->source->getContent());
}
/**

View File

@@ -84,7 +84,7 @@ class FileResourceTest extends PHPUnit_Smarty
public function testGetTemplateSource()
{
$tpl = $this->smarty->createTemplate('helloworld.tpl');
$this->assertEquals('hello world', $tpl->source->content);
$this->assertEquals('hello world', $tpl->source->getContent());
}
public function testUsesCompiler()

View File

@@ -55,7 +55,7 @@ class PhpResourceTest extends PHPUnit_Smarty
* public function testGetTemplateSource()
* {
* $tpl = $this->smarty->createTemplate('php:phphelloworld.php');
* $this->assertContains('php hello world', $tpl->source->content);
* $this->assertContains('php hello world', $tpl->source->getContent());
* }
* /**
* test usesCompiler

View File

@@ -60,7 +60,7 @@ class StreamResourceTest extends PHPUnit_Smarty
public function testGetTemplateSource()
{
$tpl = $this->smarty->createTemplate('global:mytest', null, null, $this->smarty);
$this->assertEquals('hello world {$foo}', $tpl->source->content);
$this->assertEquals('hello world {$foo}', $tpl->source->getContent());
}
/**

View File

@@ -72,7 +72,7 @@ class StringResourceTest extends PHPUnit_Smarty
public function testGetTemplateSource()
{
$tpl = $this->smarty->createTemplate('string:hello world{$foo}');
$this->assertEquals('hello world{$foo}', $tpl->source->content);
$this->assertEquals('hello world{$foo}', $tpl->source->getContent());
}
/**

View File

@@ -43,7 +43,7 @@ class CompilePhpTest extends PHPUnit_Smarty
$this->smartyBC->compile_id = $testName;
$tpl = $this->smartyBC->createTemplate($templateFile);
if ($phpHandling == Smarty::PHP_PASSTHRU || $phpHandling == Smarty::PHP_QUOTE) {
$result = str_replace("\r", '', $tpl->source->content);
$result = str_replace("\r", '', $tpl->source->getContent());
}
if ($phpHandling == Smarty::PHP_QUOTE) {
$result = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i', array($this, 'quote'), $result);