diff --git a/tests/Node/Expression/CallTest.php b/tests/Node/Expression/CallTest.php index 08e65228f..c6530dab9 100644 --- a/tests/Node/Expression/CallTest.php +++ b/tests/Node/Expression/CallTest.php @@ -158,7 +158,6 @@ class CallTest extends TestCase private function getArguments($call, $args) { $m = new \ReflectionMethod($call, 'getArguments'); - $m->setAccessible(true); return $m->invokeArgs($call, $args); } diff --git a/tests/ParserTest.php b/tests/ParserTest.php index d103fefbf..4648b5b6c 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -77,7 +77,6 @@ class ParserTest extends TestCase { $parser = $this->getParser(); $m = new \ReflectionMethod($parser, 'filterBodyNodes'); - $m->setAccessible(true); $this->assertEquals($expected, $m->invoke($parser, $input)); } @@ -108,7 +107,6 @@ class ParserTest extends TestCase $parser = $this->getParser(); $m = new \ReflectionMethod($parser, 'filterBodyNodes'); - $m->setAccessible(true); $this->expectException(SyntaxError::class); $m->invoke($parser, $input); @@ -130,7 +128,6 @@ class ParserTest extends TestCase $parser = $this->getParser(); $m = new \ReflectionMethod($parser, 'filterBodyNodes'); - $m->setAccessible(true); $this->assertNull($m->invoke($parser, new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$emptyNode, 1))); } @@ -165,7 +162,6 @@ class ParserTest extends TestCase ], new Source('', ''))); $p = new \ReflectionProperty($parser, 'parent'); - $p->setAccessible(true); $this->assertNull($p->getValue($parser)); } @@ -216,7 +212,6 @@ EOF $parser->setParent(new EmptyNode()); $p = new \ReflectionProperty($parser, 'stream'); - $p->setAccessible(true); $p->setValue($parser, new TokenStream([], new Source('', ''))); return $parser; diff --git a/tests/Profiler/Dumper/ProfilerTestCase.php b/tests/Profiler/Dumper/ProfilerTestCase.php index 24f2da2a1..30f79673b 100644 --- a/tests/Profiler/Dumper/ProfilerTestCase.php +++ b/tests/Profiler/Dumper/ProfilerTestCase.php @@ -48,7 +48,6 @@ abstract class ProfilerTestCase extends TestCase ]; $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); $p->setValue($profile, $subProfiles); return $profile; @@ -92,18 +91,15 @@ abstract class ProfilerTestCase extends TestCase $profile = new Profile($templateName, $type, $name); $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); $p->setValue($profile, $subProfiles); $starts = new \ReflectionProperty($profile, 'starts'); - $starts->setAccessible(true); $starts->setValue($profile, [ 'wt' => 0, 'mu' => 0, 'pmu' => 0, ]); $ends = new \ReflectionProperty($profile, 'ends'); - $ends->setAccessible(true); $ends->setValue($profile, [ 'wt' => $duration, 'mu' => 0, diff --git a/tests/TemplateTest.php b/tests/TemplateTest.php index 8cdb8d065..74ac5a7cb 100644 --- a/tests/TemplateTest.php +++ b/tests/TemplateTest.php @@ -203,7 +203,7 @@ class TemplateTest extends TestCase } $this->assertSame('FloatButString', $array['1.5']); $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']); - $this->assertSame('EmptyString', $array[null]); + $this->assertSame('EmptyString', $array['']); $this->assertSame('Zero', CoreExtension::getAttribute($twig, $template->getSourceContext(), $array, false), 'false is treated as 0 when accessing a sequence/mapping (equals PHP behavior)'); $this->assertSame('One', CoreExtension::getAttribute($twig, $template->getSourceContext(), $array, true), 'true is treated as 1 when accessing a sequence/mapping (equals PHP behavior)');