added some unit tests for previous merge

This commit is contained in:
Fabien Potencier
2012-10-31 13:42:47 +01:00
committed by Tobias Schultze
parent e84448bc84
commit c4d5b3ffdb
+17
View File
@@ -199,6 +199,8 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
'null' => null,
'1' => 1,
'bar' => true,
'09' => '09',
'+4' => '+4',
);
$objectArray = new Twig_TemplateArrayAccessObject();
@@ -224,6 +226,8 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
array(true, 1, 1.0),
array(true, null, 'null'),
array(true, true, 'bar'),
array(true, '09', '09'),
array(true, '+4', '+4'),
);
$testObjects = array(
// array(object, type of fetch)
@@ -243,6 +247,10 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
foreach ($basicTests as $test) {
// properties cannot be numbers
if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) {
continue;
}
if ('+4' === $test[2] && $methodObject === $testObject[0]) {
continue;
}
@@ -380,6 +388,8 @@ class Twig_TemplateArrayAccessObject implements ArrayAccess
'null' => null,
'1' => 1,
'bar' => true,
'09' => '09',
'+4' => '+4',
);
public function offsetExists($name)
@@ -410,6 +420,8 @@ class Twig_TemplateMagicPropertyObject
'null' => null,
'1' => 1,
'bar' => true,
'09' => '09',
'+4' => '+4',
);
protected $protected = 'protected';
@@ -478,6 +490,11 @@ class Twig_TemplateMethodObject
return 1;
}
public function get09()
{
return '09';
}
public function getZero()
{
return 0;