mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-15 00:06:20 +00:00
Remove obsolete code (setAccessible(true))
This commit is contained in:
@@ -188,7 +188,6 @@ abstract class IntegrationTestCase extends TestCase
|
||||
|
||||
// avoid using the same PHP class name for different cases
|
||||
$p = new \ReflectionProperty($twig, 'templateClassPrefix');
|
||||
$p->setAccessible(true);
|
||||
$p->setValue($twig, '__TwigTemplate_'.hash('xxh128', uniqid((string) mt_rand(), true), false).'_');
|
||||
|
||||
$deprecations = [];
|
||||
|
||||
@@ -100,7 +100,6 @@ class CallTest extends TestCase
|
||||
private function getArguments($call, $args)
|
||||
{
|
||||
$m = new \ReflectionMethod($call, 'getArguments');
|
||||
$m->setAccessible(true);
|
||||
|
||||
return $m->invokeArgs($call, $args);
|
||||
}
|
||||
|
||||
@@ -63,8 +63,6 @@ class ParserTest extends TestCase
|
||||
{
|
||||
$parser = $this->getParser();
|
||||
$m = new \ReflectionMethod($parser, 'filterBodyNodes');
|
||||
$m->setAccessible(true);
|
||||
|
||||
$this->assertEquals($expected, $m->invoke($parser, $input));
|
||||
}
|
||||
|
||||
@@ -96,8 +94,6 @@ class ParserTest extends TestCase
|
||||
$parser = $this->getParser();
|
||||
|
||||
$m = new \ReflectionMethod($parser, 'filterBodyNodes');
|
||||
$m->setAccessible(true);
|
||||
|
||||
$m->invoke($parser, $input);
|
||||
}
|
||||
|
||||
@@ -117,7 +113,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)));
|
||||
}
|
||||
|
||||
@@ -181,7 +176,6 @@ EOF
|
||||
$parser->setParent(new Node());
|
||||
|
||||
$p = new \ReflectionProperty($parser, 'stream');
|
||||
$p->setAccessible(true);
|
||||
$p->setValue($parser, new TokenStream([]));
|
||||
|
||||
return $parser;
|
||||
|
||||
@@ -39,7 +39,6 @@ abstract class AbstractTest extends TestCase
|
||||
];
|
||||
|
||||
$p = new \ReflectionProperty($profile, 'profiles');
|
||||
$p->setAccessible(true);
|
||||
$p->setValue($profile, $subProfiles);
|
||||
|
||||
return $profile;
|
||||
@@ -83,18 +82,15 @@ abstract class AbstractTest 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,
|
||||
|
||||
Reference in New Issue
Block a user