mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Added tests for SSViewer variables
From: Sam Minnee <sam@silverstripe.com> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93719 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ae04c15e35
commit
ec2e15f649
@ -50,16 +50,45 @@ SS
|
|||||||
|
|
||||||
function testObjectDotArguments() {
|
function testObjectDotArguments() {
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$this->render("\$TestObject.methodWithOneArgument(one)"),
|
'[out:TestObject.methodWithOneArgument(one)]
|
||||||
"TestObject.methodWithOneArgument(one)",
|
[out:TestObject.methodWithTwoArguments(one,two)]
|
||||||
"Object method calls in dot notation work with one argument"
|
[out:TestMethod(Arg1,Arg2).Bar.Val]
|
||||||
|
[out:TestMethod(Arg1,Arg2).Bar]
|
||||||
|
[out:TestMethod(Arg1,Arg2)]
|
||||||
|
[out:TestMethod(Arg1).Bar.Val]
|
||||||
|
[out:TestMethod(Arg1).Bar]
|
||||||
|
[out:TestMethod(Arg1)]',
|
||||||
|
$this->render('$TestObject.methodWithOneArgument(one)
|
||||||
|
$TestObject.methodWithTwoArguments(one,two)
|
||||||
|
$TestMethod(Arg1, Arg2).Bar.Val
|
||||||
|
$TestMethod(Arg1, Arg2).Bar
|
||||||
|
$TestMethod(Arg1, Arg2)
|
||||||
|
$TestMethod(Arg1).Bar.Val
|
||||||
|
$TestMethod(Arg1).Bar
|
||||||
|
$TestMethod(Arg1)')
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// two arguments
|
function testEscapedArguments() {
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$this->render("\$TestObject.methodWithTwoArguments(one,two)"),
|
'[out:Foo(Arg1,Arg2).Bar.Val].Suffix
|
||||||
"TestObject.methodWithTwoArguments(one,two)",
|
[out:Foo(Arg1,Arg2).Val]_Suffix
|
||||||
"Object method calls in dot notation work with two arguments"
|
[out:Foo(Arg1,Arg2)]/Suffix
|
||||||
|
[out:Foo(Arg1).Bar.Val]textSuffix
|
||||||
|
[out:Foo(Arg1).Bar].Suffix
|
||||||
|
[out:Foo(Arg1)].Suffix
|
||||||
|
[out:Foo.Bar.Val].Suffix
|
||||||
|
[out:Foo.Bar].Suffix
|
||||||
|
[out:Foo].Suffix',
|
||||||
|
$this->render('{$Foo(Arg1, Arg2).Bar.Val}.Suffix
|
||||||
|
{$Foo(Arg1, Arg2).Val}_Suffix
|
||||||
|
{$Foo(Arg1, Arg2)}/Suffix
|
||||||
|
{$Foo(Arg1).Bar.Val}textSuffix
|
||||||
|
{$Foo(Arg1).Bar}.Suffix
|
||||||
|
{$Foo(Arg1)}.Suffix
|
||||||
|
{$Foo.Bar.Val}.Suffix
|
||||||
|
{$Foo.Bar}.Suffix
|
||||||
|
{$Foo}.Suffix')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user