mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add string concatenation (#3)
This commit is contained in:
@@ -676,10 +676,20 @@ class TemplateTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public static function providerConcat() {
|
||||
return array(
|
||||
array('{"string" ~ $one ~ up("end")}', "string1END"),
|
||||
array('{"string" ~ $one++ ~ "end"}', "string1end"),
|
||||
array('{"string" ~ ++$one ~ "end"}', "string2end"),
|
||||
array('{"string" ~ "one" ~ "end"}', "stringoneend"),
|
||||
array('{"string" ~ 1 ~ "end"}', "string1end"),
|
||||
);
|
||||
}
|
||||
|
||||
public function _testSandbox()
|
||||
{
|
||||
try {
|
||||
var_dump($this->fenom->compileCode('{$a!"no way":"right"}')->getBody());
|
||||
var_dump($this->fenom->compileCode('{$a++~"hi"~time("Y:m:d")}')->getBody());
|
||||
} catch (\Exception $e) {
|
||||
print_r($e->getMessage() . "\n" . $e->getTraceAsString());
|
||||
}
|
||||
@@ -891,5 +901,13 @@ class TemplateTest extends TestCase
|
||||
{
|
||||
$this->exec($code, self::getVars(), $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerConcat
|
||||
*/
|
||||
public function testConcat($code, $result)
|
||||
{
|
||||
$this->exec($code, self::getVars(), $result);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user