... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -9,7 +11,7 @@ |
9 | 11 |
* file that was distributed with this source code. |
10 | 12 |
*/ |
11 | 13 |
|
12 |
-class Twig_Tests_AutoloaderTest extends \PHPUnit\Framework\TestCase |
|
14 |
+class AutoloaderTest extends \PHPUnit\Framework\TestCase |
|
13 | 15 |
{ |
14 | 16 |
/** |
15 | 17 |
* @group legacy |
... | ... |
@@ -18,7 +20,7 @@ class Twig_Tests_AutoloaderTest extends \PHPUnit\Framework\TestCase |
18 | 20 |
{ |
19 | 21 |
$this->assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig'); |
20 | 22 |
|
21 |
- $autoloader = new Twig_Autoloader(); |
|
23 |
+ $autoloader = new \Twig_Autoloader(); |
|
22 | 24 |
$this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class'); |
23 | 25 |
} |
24 | 26 |
} |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Cache; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -10,10 +12,9 @@ |
10 | 12 |
*/ |
11 | 13 |
|
12 | 14 |
use Twig\Cache\FilesystemCache; |
15 |
+use Twig\Tests\FilesystemHelper; |
|
13 | 16 |
|
14 |
-require_once \dirname(__DIR__).'/FilesystemHelper.php'; |
|
15 |
- |
|
16 |
-class Twig_Tests_Cache_FilesystemTest extends \PHPUnit\Framework\TestCase |
|
17 |
+class FilesystemTest extends \PHPUnit\Framework\TestCase |
|
17 | 18 |
{ |
18 | 19 |
private $classname; |
19 | 20 |
private $directory; |
... | ... |
@@ -30,7 +31,7 @@ class Twig_Tests_Cache_FilesystemTest extends \PHPUnit\Framework\TestCase |
30 | 31 |
protected function tearDown() |
31 | 32 |
{ |
32 | 33 |
if (file_exists($this->directory)) { |
33 |
- Twig_Tests_FilesystemHelper::removeDir($this->directory); |
|
34 |
+ FilesystemHelper::removeDir($this->directory); |
|
34 | 35 |
} |
35 | 36 |
} |
36 | 37 |
|
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -12,7 +14,7 @@ |
12 | 14 |
use Twig\Compiler; |
13 | 15 |
use Twig\Environment; |
14 | 16 |
|
15 |
-class Twig_Tests_CompilerTest extends \PHPUnit\Framework\TestCase |
|
17 |
+class CompilerTest extends \PHPUnit\Framework\TestCase |
|
16 | 18 |
{ |
17 | 19 |
public function testReprNumericValueWithLocale() |
18 | 20 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -11,7 +13,7 @@ |
11 | 13 |
|
12 | 14 |
use Twig\RuntimeLoader\ContainerRuntimeLoader; |
13 | 15 |
|
14 |
-class Twig_Tests_ContainerRuntimeLoaderTest extends \PHPUnit\Framework\TestCase |
|
16 |
+class ContainerRuntimeLoaderTest extends \PHPUnit\Framework\TestCase |
|
15 | 17 |
{ |
16 | 18 |
/** |
17 | 19 |
* @requires PHP 5.3 |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -35,8 +37,8 @@ class CustomExtensionTest extends \PHPUnit\Framework\TestCase |
35 | 37 |
public function provideInvalidExtensions() |
36 | 38 |
{ |
37 | 39 |
return [ |
38 |
- [new InvalidOperatorExtension(new \stdClass()), '"InvalidOperatorExtension::getOperators()" must return an array with operators, got "stdClass".'], |
|
39 |
- [new InvalidOperatorExtension([1, 2, 3]), '"InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'], |
|
40 |
+ [new InvalidOperatorExtension(new \stdClass()), '"Twig\Tests\InvalidOperatorExtension::getOperators()" must return an array with operators, got "stdClass".'], |
|
41 |
+ [new InvalidOperatorExtension([1, 2, 3]), '"Twig\Tests\InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'], |
|
40 | 42 |
]; |
41 | 43 |
} |
42 | 44 |
} |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -25,9 +27,7 @@ use Twig\TwigFilter; |
25 | 27 |
use Twig\TwigFunction; |
26 | 28 |
use Twig\TwigTest; |
27 | 29 |
|
28 |
-require_once __DIR__.'/FilesystemHelper.php'; |
|
29 |
- |
|
30 |
-class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
|
30 |
+class EnvironmentTest extends \PHPUnit\Framework\TestCase |
|
31 | 31 |
{ |
32 | 32 |
private $deprecations = []; |
33 | 33 |
|
... | ... |
@@ -88,7 +88,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
88 | 88 |
public function testGlobals() |
89 | 89 |
{ |
90 | 90 |
// to be removed in 2.0 |
91 |
- $loader = $this->getMockBuilder('Twig_EnvironmentTestLoaderInterface')->getMock(); |
|
91 |
+ $loader = $this->getMockBuilder('\Twig\Tests\EnvironmentTestLoaderInterface')->getMock(); |
|
92 | 92 |
//$loader = $this->getMockBuilder(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface'])->getMock(); |
93 | 93 |
$loader->expects($this->any())->method('getSourceContext')->willReturn(new Source('', '')); |
94 | 94 |
|
... | ... |
@@ -211,7 +211,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
211 | 211 |
$output = $twig->render('index', ['foo' => 'bar']); |
212 | 212 |
$this->assertEquals('bar', $output); |
213 | 213 |
|
214 |
- Twig_Tests_FilesystemHelper::removeDir($dir); |
|
214 |
+ FilesystemHelper::removeDir($dir); |
|
215 | 215 |
} |
216 | 216 |
|
217 | 217 |
public function testAutoReloadCacheMiss() |
... | ... |
@@ -304,15 +304,15 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
304 | 304 |
{ |
305 | 305 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
306 | 306 |
|
307 |
- $ext1 = new Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName('ext1'); |
|
308 |
- $ext2 = new Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName('ext2'); |
|
307 |
+ $ext1 = new EnvironmentTest_Extension_DynamicWithDeprecatedName('ext1'); |
|
308 |
+ $ext2 = new EnvironmentTest_Extension_DynamicWithDeprecatedName('ext2'); |
|
309 | 309 |
$twig->addExtension($ext1); |
310 | 310 |
$twig->addExtension($ext2); |
311 | 311 |
|
312 | 312 |
$this->assertTrue($twig->hasExtension('ext1')); |
313 | 313 |
$this->assertTrue($twig->hasExtension('ext2')); |
314 | 314 |
|
315 |
- $this->assertTrue($twig->hasExtension('Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName')); |
|
315 |
+ $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest_Extension_DynamicWithDeprecatedName')); |
|
316 | 316 |
|
317 | 317 |
$this->assertSame($ext1, $twig->getExtension('ext1')); |
318 | 318 |
$this->assertSame($ext2, $twig->getExtension('ext2')); |
... | ... |
@@ -321,12 +321,12 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
321 | 321 |
public function testHasGetExtensionByClassName() |
322 | 322 |
{ |
323 | 323 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
324 |
- $twig->addExtension($ext = new Twig_Tests_EnvironmentTest_Extension()); |
|
325 |
- $this->assertTrue($twig->hasExtension('Twig_Tests_EnvironmentTest_Extension')); |
|
326 |
- $this->assertTrue($twig->hasExtension('\Twig_Tests_EnvironmentTest_Extension')); |
|
324 |
+ $twig->addExtension($ext = new EnvironmentTest_Extension()); |
|
325 |
+ $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest_Extension')); |
|
326 |
+ $this->assertTrue($twig->hasExtension('\Twig\Tests\EnvironmentTest_Extension')); |
|
327 | 327 |
|
328 |
- $this->assertSame($ext, $twig->getExtension('Twig_Tests_EnvironmentTest_Extension')); |
|
329 |
- $this->assertSame($ext, $twig->getExtension('\Twig_Tests_EnvironmentTest_Extension')); |
|
328 |
+ $this->assertSame($ext, $twig->getExtension('Twig\Tests\EnvironmentTest_Extension')); |
|
329 |
+ $this->assertSame($ext, $twig->getExtension('\Twig\Tests\EnvironmentTest_Extension')); |
|
330 | 330 |
|
331 | 331 |
$this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest\Extension')); |
332 | 332 |
$this->assertSame($ext, $twig->getExtension('Twig\Tests\EnvironmentTest\Extension')); |
... | ... |
@@ -335,7 +335,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
335 | 335 |
public function testAddExtension() |
336 | 336 |
{ |
337 | 337 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
338 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); |
|
338 |
+ $twig->addExtension(new EnvironmentTest_Extension()); |
|
339 | 339 |
|
340 | 340 |
$this->assertArrayHasKey('test', $twig->getTags()); |
341 | 341 |
$this->assertArrayHasKey('foo_filter', $twig->getFilters()); |
... | ... |
@@ -347,7 +347,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
347 | 347 |
$visitors = $twig->getNodeVisitors(); |
348 | 348 |
$found = false; |
349 | 349 |
foreach ($visitors as $visitor) { |
350 |
- if ($visitor instanceof Twig_Tests_EnvironmentTest_NodeVisitor) { |
|
350 |
+ if ($visitor instanceof EnvironmentTest_NodeVisitor) { |
|
351 | 351 |
$found = true; |
352 | 352 |
} |
353 | 353 |
} |
... | ... |
@@ -360,7 +360,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
360 | 360 |
public function testAddExtensionWithDeprecatedGetGlobals() |
361 | 361 |
{ |
362 | 362 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
363 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithGlobals()); |
|
363 |
+ $twig->addExtension(new EnvironmentTest_Extension_WithGlobals()); |
|
364 | 364 |
|
365 | 365 |
$this->deprecations = []; |
366 | 366 |
set_error_handler([$this, 'handleError']); |
... | ... |
@@ -368,7 +368,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
368 | 368 |
$this->assertArrayHasKey('foo_global', $twig->getGlobals()); |
369 | 369 |
|
370 | 370 |
$this->assertCount(1, $this->deprecations); |
371 |
- $this->assertContains('Defining the getGlobals() method in the "Twig_Tests_EnvironmentTest_Extension_WithGlobals" extension ', $this->deprecations[0]); |
|
371 |
+ $this->assertContains('Defining the getGlobals() method in the "Twig\Tests\EnvironmentTest_Extension_WithGlobals" extension ', $this->deprecations[0]); |
|
372 | 372 |
|
373 | 373 |
restore_error_handler(); |
374 | 374 |
} |
... | ... |
@@ -379,7 +379,7 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
379 | 379 |
public function testRemoveExtension() |
380 | 380 |
{ |
381 | 381 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
382 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName()); |
|
382 |
+ $twig->addExtension(new EnvironmentTest_Extension_WithDeprecatedName()); |
|
383 | 383 |
$twig->removeExtension('environment_test'); |
384 | 384 |
|
385 | 385 |
$this->assertArrayNotHasKey('test', $twig->getTags()); |
... | ... |
@@ -399,12 +399,12 @@ class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase |
399 | 399 |
$extension = eval(<<<EOF |
400 | 400 |
use Twig\Extension\AbstractExtension; |
401 | 401 |
|
402 |
-class Twig_Tests_EnvironmentTest_ExtensionInEval extends AbstractExtension |
|
402 |
+class EnvironmentTest_ExtensionInEval extends AbstractExtension |
|
403 | 403 |
{ |
404 | 404 |
} |
405 | 405 |
EOF |
406 | 406 |
); |
407 |
- $extension = new Twig_Tests_EnvironmentTest_ExtensionInEval(); |
|
407 |
+ $extension = new \EnvironmentTest_ExtensionInEval(); |
|
408 | 408 |
|
409 | 409 |
$loader = new ArrayLoader(['page' => 'hey']); |
410 | 410 |
|
... | ... |
@@ -418,7 +418,7 @@ EOF |
418 | 418 |
public function testInitRuntimeWithAnExtensionUsingInitRuntimeNoDeprecation() |
419 | 419 |
{ |
420 | 420 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
421 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithoutDeprecationInitRuntime()); |
|
421 |
+ $twig->addExtension(new EnvironmentTest_ExtensionWithoutDeprecationInitRuntime()); |
|
422 | 422 |
$twig->initRuntime(); |
423 | 423 |
|
424 | 424 |
// add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above |
... | ... |
@@ -432,7 +432,7 @@ EOF |
432 | 432 |
public function testInitRuntimeWithAnExtensionUsingInitRuntimeDeprecation() |
433 | 433 |
{ |
434 | 434 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
435 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime()); |
|
435 |
+ $twig->addExtension(new EnvironmentTest_ExtensionWithDeprecationInitRuntime()); |
|
436 | 436 |
|
437 | 437 |
$this->deprecations = []; |
438 | 438 |
set_error_handler([$this, 'handleError']); |
... | ... |
@@ -440,7 +440,7 @@ EOF |
440 | 440 |
$twig->initRuntime(); |
441 | 441 |
|
442 | 442 |
$this->assertCount(1, $this->deprecations); |
443 |
- $this->assertContains('Defining the initRuntime() method in the "Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime" extension is deprecated since version 1.23.', $this->deprecations[0]); |
|
443 |
+ $this->assertContains('Defining the initRuntime() method in the "Twig\Tests\EnvironmentTest_ExtensionWithDeprecationInitRuntime" extension is deprecated since version 1.23.', $this->deprecations[0]); |
|
444 | 444 |
|
445 | 445 |
restore_error_handler(); |
446 | 446 |
} |
... | ... |
@@ -458,13 +458,13 @@ EOF |
458 | 458 |
public function testOverrideExtension() |
459 | 459 |
{ |
460 | 460 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
461 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime()); |
|
461 |
+ $twig->addExtension(new EnvironmentTest_ExtensionWithDeprecationInitRuntime()); |
|
462 | 462 |
|
463 | 463 |
$this->deprecations = []; |
464 | 464 |
set_error_handler([$this, 'handleError']); |
465 | 465 |
|
466 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName()); |
|
467 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName()); |
|
466 |
+ $twig->addExtension(new EnvironmentTest_Extension_WithDeprecatedName()); |
|
467 |
+ $twig->addExtension(new EnvironmentTest_Extension_WithDeprecatedName()); |
|
468 | 468 |
|
469 | 469 |
$this->assertCount(1, $this->deprecations); |
470 | 470 |
$this->assertContains('The possibility to register the same extension twice', $this->deprecations[0]); |
... | ... |
@@ -475,7 +475,7 @@ EOF |
475 | 475 |
public function testAddRuntimeLoader() |
476 | 476 |
{ |
477 | 477 |
$runtimeLoader = $this->getMockBuilder('\Twig\RuntimeLoader\RuntimeLoaderInterface')->getMock(); |
478 |
- $runtimeLoader->expects($this->any())->method('load')->willReturn(new Twig_Tests_EnvironmentTest_Runtime()); |
|
478 |
+ $runtimeLoader->expects($this->any())->method('load')->willReturn(new EnvironmentTest_Runtime()); |
|
479 | 479 |
|
480 | 480 |
$loader = new ArrayLoader([ |
481 | 481 |
'func_array' => '{{ from_runtime_array("foo") }}', |
... | ... |
@@ -487,7 +487,7 @@ EOF |
487 | 487 |
]); |
488 | 488 |
|
489 | 489 |
$twig = new Environment($loader); |
490 |
- $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime()); |
|
490 |
+ $twig->addExtension(new EnvironmentTest_ExtensionWithoutRuntime()); |
|
491 | 491 |
$twig->addRuntimeLoader($runtimeLoader); |
492 | 492 |
|
493 | 493 |
$this->assertEquals('foo', $twig->render('func_array')); |
... | ... |
@@ -501,7 +501,7 @@ EOF |
501 | 501 |
protected function getMockLoader($templateName, $templateContent) |
502 | 502 |
{ |
503 | 503 |
// to be removed in 2.0 |
504 |
- $loader = $this->getMockBuilder('Twig_EnvironmentTestLoaderInterface')->getMock(); |
|
504 |
+ $loader = $this->getMockBuilder('Twig\Tests\EnvironmentTestLoaderInterface')->getMock(); |
|
505 | 505 |
//$loader = $this->getMockBuilder(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface'])->getMock(); |
506 | 506 |
$loader->expects($this->any()) |
507 | 507 |
->method('getSourceContext') |
... | ... |
@@ -516,7 +516,7 @@ EOF |
516 | 516 |
} |
517 | 517 |
} |
518 | 518 |
|
519 |
-class Twig_Tests_EnvironmentTest_Extension_WithGlobals extends AbstractExtension |
|
519 |
+class EnvironmentTest_Extension_WithGlobals extends AbstractExtension |
|
520 | 520 |
{ |
521 | 521 |
public function getGlobals() |
522 | 522 |
{ |
... | ... |
@@ -526,19 +526,19 @@ class Twig_Tests_EnvironmentTest_Extension_WithGlobals extends AbstractExtension |
526 | 526 |
} |
527 | 527 |
} |
528 | 528 |
|
529 |
-class Twig_Tests_EnvironmentTest_Extension extends AbstractExtension implements GlobalsInterface |
|
529 |
+class EnvironmentTest_Extension extends AbstractExtension implements GlobalsInterface |
|
530 | 530 |
{ |
531 | 531 |
public function getTokenParsers() |
532 | 532 |
{ |
533 | 533 |
return [ |
534 |
- new Twig_Tests_EnvironmentTest_TokenParser(), |
|
534 |
+ new EnvironmentTest_TokenParser(), |
|
535 | 535 |
]; |
536 | 536 |
} |
537 | 537 |
|
538 | 538 |
public function getNodeVisitors() |
539 | 539 |
{ |
540 | 540 |
return [ |
541 |
- new Twig_Tests_EnvironmentTest_NodeVisitor(), |
|
541 |
+ new EnvironmentTest_NodeVisitor(), |
|
542 | 542 |
]; |
543 | 543 |
} |
544 | 544 |
|
... | ... |
@@ -578,9 +578,9 @@ class Twig_Tests_EnvironmentTest_Extension extends AbstractExtension implements |
578 | 578 |
]; |
579 | 579 |
} |
580 | 580 |
} |
581 |
-class_alias('Twig_Tests_EnvironmentTest_Extension', 'Twig\Tests\EnvironmentTest\Extension', false); |
|
581 |
+class_alias('\Twig\Tests\EnvironmentTest_Extension', 'Twig\Tests\EnvironmentTest\Extension', false); |
|
582 | 582 |
|
583 |
-class Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName extends AbstractExtension |
|
583 |
+class EnvironmentTest_Extension_WithDeprecatedName extends AbstractExtension |
|
584 | 584 |
{ |
585 | 585 |
public function getName() |
586 | 586 |
{ |
... | ... |
@@ -588,7 +588,7 @@ class Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName extends AbstractEx |
588 | 588 |
} |
589 | 589 |
} |
590 | 590 |
|
591 |
-class Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName extends AbstractExtension |
|
591 |
+class EnvironmentTest_Extension_DynamicWithDeprecatedName extends AbstractExtension |
|
592 | 592 |
{ |
593 | 593 |
private $name; |
594 | 594 |
|
... | ... |
@@ -603,7 +603,7 @@ class Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName extends Abs |
603 | 603 |
} |
604 | 604 |
} |
605 | 605 |
|
606 |
-class Twig_Tests_EnvironmentTest_TokenParser extends AbstractTokenParser |
|
606 |
+class EnvironmentTest_TokenParser extends AbstractTokenParser |
|
607 | 607 |
{ |
608 | 608 |
public function parse(Token $token) |
609 | 609 |
{ |
... | ... |
@@ -615,14 +615,14 @@ class Twig_Tests_EnvironmentTest_TokenParser extends AbstractTokenParser |
615 | 615 |
} |
616 | 616 |
} |
617 | 617 |
|
618 |
-class Twig_Tests_EnvironmentTest_NodeVisitor implements NodeVisitorInterface |
|
618 |
+class EnvironmentTest_NodeVisitor implements NodeVisitorInterface |
|
619 | 619 |
{ |
620 |
- public function enterNode(Twig_NodeInterface $node, Environment $env) |
|
620 |
+ public function enterNode(\Twig_NodeInterface $node, Environment $env) |
|
621 | 621 |
{ |
622 | 622 |
return $node; |
623 | 623 |
} |
624 | 624 |
|
625 |
- public function leaveNode(Twig_NodeInterface $node, Environment $env) |
|
625 |
+ public function leaveNode(\Twig_NodeInterface $node, Environment $env) |
|
626 | 626 |
{ |
627 | 627 |
return $node; |
628 | 628 |
} |
... | ... |
@@ -633,27 +633,27 @@ class Twig_Tests_EnvironmentTest_NodeVisitor implements NodeVisitorInterface |
633 | 633 |
} |
634 | 634 |
} |
635 | 635 |
|
636 |
-class Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime extends AbstractExtension |
|
636 |
+class EnvironmentTest_ExtensionWithDeprecationInitRuntime extends AbstractExtension |
|
637 | 637 |
{ |
638 | 638 |
public function initRuntime(Environment $env) |
639 | 639 |
{ |
640 | 640 |
} |
641 | 641 |
} |
642 | 642 |
|
643 |
-class Twig_Tests_EnvironmentTest_ExtensionWithoutDeprecationInitRuntime extends AbstractExtension implements InitRuntimeInterface |
|
643 |
+class EnvironmentTest_ExtensionWithoutDeprecationInitRuntime extends AbstractExtension implements InitRuntimeInterface |
|
644 | 644 |
{ |
645 | 645 |
public function initRuntime(Environment $env) |
646 | 646 |
{ |
647 | 647 |
} |
648 | 648 |
} |
649 | 649 |
|
650 |
-class Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime extends AbstractExtension |
|
650 |
+class EnvironmentTest_ExtensionWithoutRuntime extends AbstractExtension |
|
651 | 651 |
{ |
652 | 652 |
public function getFunctions() |
653 | 653 |
{ |
654 | 654 |
return [ |
655 |
- new TwigFunction('from_runtime_array', ['Twig_Tests_EnvironmentTest_Runtime', 'fromRuntime']), |
|
656 |
- new TwigFunction('from_runtime_string', 'Twig_Tests_EnvironmentTest_Runtime::fromRuntime'), |
|
655 |
+ new TwigFunction('from_runtime_array', ['Twig\Tests\EnvironmentTest_Runtime', 'fromRuntime']), |
|
656 |
+ new TwigFunction('from_runtime_string', 'Twig\Tests\EnvironmentTest_Runtime::fromRuntime'), |
|
657 | 657 |
]; |
658 | 658 |
} |
659 | 659 |
|
... | ... |
@@ -663,7 +663,7 @@ class Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime extends AbstractExtensi |
663 | 663 |
} |
664 | 664 |
} |
665 | 665 |
|
666 |
-class Twig_Tests_EnvironmentTest_Runtime |
|
666 |
+class EnvironmentTest_Runtime |
|
667 | 667 |
{ |
668 | 668 |
public function fromRuntime($name = 'bar') |
669 | 669 |
{ |
... | ... |
@@ -672,6 +672,6 @@ class Twig_Tests_EnvironmentTest_Runtime |
672 | 672 |
} |
673 | 673 |
|
674 | 674 |
// to be removed in 2.0 |
675 |
-interface Twig_EnvironmentTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface |
|
675 |
+interface EnvironmentTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface |
|
676 | 676 |
{ |
677 | 677 |
} |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -16,7 +18,7 @@ use Twig\Loader\ArrayLoader; |
16 | 18 |
use Twig\Loader\FilesystemLoader; |
17 | 19 |
use Twig\Source; |
18 | 20 |
|
19 |
-class Twig_Tests_ErrorTest extends \PHPUnit\Framework\TestCase |
|
21 |
+class ErrorTest extends \PHPUnit\Framework\TestCase |
|
20 | 22 |
{ |
21 | 23 |
public function testErrorWithObjectFilename() |
22 | 24 |
{ |
... | ... |
@@ -80,7 +82,7 @@ EOHTML |
80 | 82 |
|
81 | 83 |
$template = $twig->load('index.html'); |
82 | 84 |
try { |
83 |
- $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); |
|
85 |
+ $template->render(['foo' => new ErrorTest_Foo()]); |
|
84 | 86 |
|
85 | 87 |
$this->fail(); |
86 | 88 |
} catch (RuntimeError $e) { |
... | ... |
@@ -116,7 +118,7 @@ EOHTML |
116 | 118 |
|
117 | 119 |
$template = $twig->load('index.html'); |
118 | 120 |
try { |
119 |
- $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); |
|
121 |
+ $template->render(['foo' => new ErrorTest_Foo()]); |
|
120 | 122 |
|
121 | 123 |
$this->fail(); |
122 | 124 |
} catch (RuntimeError $e) { |
... | ... |
@@ -149,7 +151,7 @@ EOHTML |
149 | 151 |
} |
150 | 152 |
|
151 | 153 |
try { |
152 |
- $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); |
|
154 |
+ $template->render(['foo' => new ErrorTest_Foo()]); |
|
153 | 155 |
|
154 | 156 |
$this->fail(); |
155 | 157 |
} catch (RuntimeError $e) { |
... | ... |
@@ -223,7 +225,7 @@ EOHTML |
223 | 225 |
} |
224 | 226 |
} |
225 | 227 |
|
226 |
-class Twig_Tests_ErrorTest_Foo |
|
228 |
+class ErrorTest_Foo |
|
227 | 229 |
{ |
228 | 230 |
public function bar() |
229 | 231 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -17,7 +19,7 @@ use Twig\Node\Expression\NameExpression; |
17 | 19 |
use Twig\Parser; |
18 | 20 |
use Twig\Source; |
19 | 21 |
|
20 |
-class Twig_Tests_ExpressionParserTest extends \PHPUnit\Framework\TestCase |
|
22 |
+class ExpressionParserTest extends \PHPUnit\Framework\TestCase |
|
21 | 23 |
{ |
22 | 24 |
/** |
23 | 25 |
* @expectedException \Twig\Error\SyntaxError |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Extension; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -11,14 +13,14 @@ |
11 | 13 |
|
12 | 14 |
use Twig\Environment; |
13 | 15 |
|
14 |
-class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase |
|
16 |
+class CoreTest extends \PHPUnit\Framework\TestCase |
|
15 | 17 |
{ |
16 | 18 |
/** |
17 | 19 |
* @dataProvider getRandomFunctionTestData |
18 | 20 |
*/ |
19 | 21 |
public function testRandomFunction(array $expectedInArray, $value1, $value2 = null) |
20 | 22 |
{ |
21 |
- $env = new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()); |
|
23 |
+ $env = new Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()); |
|
22 | 24 |
for ($i = 0; $i < 100; ++$i) { |
23 | 25 |
$this->assertTrue(\in_array(twig_random($env, $value1, $value2), $expectedInArray, true)); // assertContains() would not consider the type |
24 | 26 |
} |
... | ... |
@@ -33,7 +35,7 @@ class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase |
33 | 35 |
], |
34 | 36 |
'Traversable' => [ |
35 | 37 |
['apple', 'orange', 'citrus'], |
36 |
- new ArrayObject(['apple', 'orange', 'citrus']), |
|
38 |
+ new \ArrayObject(['apple', 'orange', 'citrus']), |
|
37 | 39 |
], |
38 | 40 |
'unicode string' => [ |
39 | 41 |
['Ä', '€', 'é'], |
... | ... |
@@ -137,7 +139,7 @@ class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase |
137 | 139 |
public function testCustomEscaper($expected, $string, $strategy) |
138 | 140 |
{ |
139 | 141 |
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); |
140 |
- $twig->getExtension('\Twig\Extension\CoreExtension')->setEscaper('foo', 'foo_escaper_for_test'); |
|
142 |
+ $twig->getExtension('\Twig\Extension\CoreExtension')->setEscaper('foo', '\Twig\Tests\Extension\foo_escaper_for_test'); |
|
141 | 143 |
|
142 | 144 |
$this->assertSame($expected, twig_escape_filter($twig, $string, $strategy)); |
143 | 145 |
} |
... | ... |
@@ -320,7 +322,7 @@ final class CoreTestIteratorAggregateAggregate implements \IteratorAggregate |
320 | 322 |
} |
321 | 323 |
} |
322 | 324 |
|
323 |
-final class CoreTestIterator implements Iterator |
|
325 |
+final class CoreTestIterator implements \Iterator |
|
324 | 326 |
{ |
325 | 327 |
private $position; |
326 | 328 |
private $array; |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Extension; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -15,7 +17,7 @@ use Twig\Loader\ArrayLoader; |
15 | 17 |
use Twig\Sandbox\SecurityError; |
16 | 18 |
use Twig\Sandbox\SecurityPolicy; |
17 | 19 |
|
18 |
-class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
|
20 |
+class SandboxTest extends \PHPUnit\Framework\TestCase |
|
19 | 21 |
{ |
20 | 22 |
protected static $params; |
21 | 23 |
protected static $templates; |
... | ... |
@@ -69,7 +71,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
69 | 71 |
$this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); |
70 | 72 |
} catch (SecurityError $e) { |
71 | 73 |
$this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); |
72 |
- $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); |
|
74 |
+ $this->assertEquals('Twig\Tests\Extension\FooObject', $e->getClassName(), 'Exception should be raised on the "Twig\Tests\Extension\FooObject" class'); |
|
73 | 75 |
$this->assertEquals('foo', $e->getMethodName(), 'Exception should be raised on the "foo" method'); |
74 | 76 |
} |
75 | 77 |
} |
... | ... |
@@ -106,7 +108,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
106 | 108 |
$this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); |
107 | 109 |
} catch (SecurityError $e) { |
108 | 110 |
$this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedPropertyError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedPropertyError'); |
109 |
- $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); |
|
111 |
+ $this->assertEquals('Twig\Tests\Extension\FooObject', $e->getClassName(), 'Exception should be raised on the "Twig\Tests\Extension\FooObject" class'); |
|
110 | 112 |
$this->assertEquals('bar', $e->getPropertyName(), 'Exception should be raised on the "bar" property'); |
111 | 113 |
} |
112 | 114 |
} |
... | ... |
@@ -116,13 +118,13 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
116 | 118 |
*/ |
117 | 119 |
public function testSandboxUnallowedToString($template) |
118 | 120 |
{ |
119 |
- $twig = $this->getEnvironment(true, [], ['index' => $template], [], ['upper'], ['FooObject' => 'getAnotherFooObject'], [], ['random']); |
|
121 |
+ $twig = $this->getEnvironment(true, [], ['index' => $template], [], ['upper'], ['Twig\Tests\Extension\FooObject' => 'getAnotherFooObject'], [], ['random']); |
|
120 | 122 |
try { |
121 | 123 |
$twig->load('index')->render(self::$params); |
122 | 124 |
$this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); |
123 | 125 |
} catch (SecurityError $e) { |
124 | 126 |
$this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); |
125 |
- $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); |
|
127 |
+ $this->assertEquals('Twig\Tests\Extension\FooObject', $e->getClassName(), 'Exception should be raised on the "Twig\Tests\Extension\FooObject" class'); |
|
126 | 128 |
$this->assertEquals('__tostring', $e->getMethodName(), 'Exception should be raised on the "__toString" method'); |
127 | 129 |
} |
128 | 130 |
} |
... | ... |
@@ -151,7 +153,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
151 | 153 |
*/ |
152 | 154 |
public function testSandboxAllowedToString($template, $output) |
153 | 155 |
{ |
154 |
- $twig = $this->getEnvironment(true, [], ['index' => $template], ['set'], [], ['FooObject' => ['foo', 'getAnotherFooObject']]); |
|
156 |
+ $twig = $this->getEnvironment(true, [], ['index' => $template], ['set'], [], ['Twig\Tests\Extension\FooObject' => ['foo', 'getAnotherFooObject']]); |
|
155 | 157 |
$this->assertEquals($output, $twig->load('index')->render(self::$params)); |
156 | 158 |
} |
157 | 159 |
|
... | ... |
@@ -170,7 +172,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
170 | 172 |
|
171 | 173 |
public function testSandboxAllowMethodToString() |
172 | 174 |
{ |
173 |
- $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => '__toString']); |
|
175 |
+ $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['Twig\Tests\Extension\FooObject' => '__toString']); |
|
174 | 176 |
FooObject::reset(); |
175 | 177 |
$this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allow some methods'); |
176 | 178 |
$this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); |
... | ... |
@@ -210,7 +212,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
210 | 212 |
|
211 | 213 |
public function testSandboxAllowMethodFoo() |
212 | 214 |
{ |
213 |
- $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => 'foo']); |
|
215 |
+ $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['Twig\Tests\Extension\FooObject' => 'foo']); |
|
214 | 216 |
FooObject::reset(); |
215 | 217 |
$this->assertEquals('foo', $twig->load('1_basic1')->render(self::$params), 'Sandbox allow some methods'); |
216 | 218 |
$this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); |
... | ... |
@@ -230,7 +232,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
230 | 232 |
|
231 | 233 |
public function testSandboxAllowProperty() |
232 | 234 |
{ |
233 |
- $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], ['FooObject' => 'bar']); |
|
235 |
+ $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], ['Twig\Tests\Extension\FooObject' => 'bar']); |
|
234 | 236 |
$this->assertEquals('bar', $twig->load('1_basic4')->render(self::$params), 'Sandbox allow some properties'); |
235 | 237 |
} |
236 | 238 |
|
... | ... |
@@ -249,7 +251,7 @@ class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase |
249 | 251 |
public function testSandboxAllowFunctionsCaseInsensitive() |
250 | 252 |
{ |
251 | 253 |
foreach (['getfoobar', 'getFoobar', 'getFooBar'] as $name) { |
252 |
- $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => $name]); |
|
254 |
+ $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['Twig\Tests\Extension\FooObject' => $name]); |
|
253 | 255 |
FooObject::reset(); |
254 | 256 |
$this->assertEquals('foobarfoobar', $twig->load('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); |
255 | 257 |
$this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -11,11 +13,11 @@ |
11 | 13 |
|
12 | 14 |
use Twig\RuntimeLoader\FactoryRuntimeLoader; |
13 | 15 |
|
14 |
-class Twig_Tests_FactoryRuntimeLoaderTest extends \PHPUnit\Framework\TestCase |
|
16 |
+class FactoryRuntimeLoaderTest extends \PHPUnit\Framework\TestCase |
|
15 | 17 |
{ |
16 | 18 |
public function testLoad() |
17 | 19 |
{ |
18 |
- $loader = new FactoryRuntimeLoader(['stdClass' => 'getRuntime']); |
|
20 |
+ $loader = new FactoryRuntimeLoader(['stdClass' => '\Twig\Tests\getRuntime']); |
|
19 | 21 |
|
20 | 22 |
$this->assertInstanceOf('stdClass', $loader->load('stdClass')); |
21 | 23 |
} |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -12,9 +14,7 @@ |
12 | 14 |
use Twig\Environment; |
13 | 15 |
use Twig\Loader\ArrayLoader; |
14 | 16 |
|
15 |
-require_once __DIR__.'/FilesystemHelper.php'; |
|
16 |
- |
|
17 |
-class Twig_Tests_FileCachingTest extends \PHPUnit\Framework\TestCase |
|
17 |
+class FileCachingTest extends \PHPUnit\Framework\TestCase |
|
18 | 18 |
{ |
19 | 19 |
private $env; |
20 | 20 |
private $tmpDir; |
... | ... |
@@ -35,7 +35,7 @@ class Twig_Tests_FileCachingTest extends \PHPUnit\Framework\TestCase |
35 | 35 |
|
36 | 36 |
protected function tearDown() |
37 | 37 |
{ |
38 |
- Twig_Tests_FilesystemHelper::removeDir($this->tmpDir); |
|
38 |
+ FilesystemHelper::removeDir($this->tmpDir); |
|
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
/** |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -11,7 +13,7 @@ |
11 | 13 |
|
12 | 14 |
use Twig\FileExtensionEscapingStrategy; |
13 | 15 |
|
14 |
-class Twig_Tests_FileExtensionEscapingStrategyTest extends \PHPUnit\Framework\TestCase |
|
16 |
+class FileExtensionEscapingStrategyTest extends \PHPUnit\Framework\TestCase |
|
15 | 17 |
{ |
16 | 18 |
/** |
17 | 19 |
* @dataProvider getGuessData |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -9,7 +11,7 @@ |
9 | 11 |
* file that was distributed with this source code. |
10 | 12 |
*/ |
11 | 13 |
|
12 |
-class Twig_Tests_FilesystemHelper |
|
14 |
+class FilesystemHelper |
|
13 | 15 |
{ |
14 | 16 |
public static function removeDir($dir) |
15 | 17 |
{ |
... | ... |
@@ -12,7 +12,7 @@ Twig supports method calls |
12 | 12 |
{{ items.foo.in }} |
13 | 13 |
{{ items.foo.not }} |
14 | 14 |
--DATA-- |
15 |
-return ['foo' => 'bar', 'items' => ['foo' => new TwigTestFoo(), 'bar' => 'foo']] |
|
15 |
+return ['foo' => 'bar', 'items' => ['foo' => new Twig\Tests\TwigTestFoo(), 'bar' => 'foo']] |
|
16 | 16 |
--CONFIG-- |
17 | 17 |
return ['strict_variables' => false] |
18 | 18 |
--EXPECT-- |
... | ... |
@@ -51,7 +51,7 @@ return [ |
51 | 51 |
'nullVar' => null, |
52 | 52 |
'definedArray' => [0], |
53 | 53 |
], |
54 |
- 'object' => new TwigTestFoo(), |
|
54 |
+ 'object' => new Twig\Tests\TwigTestFoo(), |
|
55 | 55 |
] |
56 | 56 |
--CONFIG-- |
57 | 57 |
return ['strict_variables' => false] |
... | ... |
@@ -106,7 +106,7 @@ return [ |
106 | 106 |
'nullVar' => null, |
107 | 107 |
'definedArray' => [0], |
108 | 108 |
], |
109 |
- 'object' => new TwigTestFoo(), |
|
109 |
+ 'object' => new Twig\Tests\TwigTestFoo(), |
|
110 | 110 |
] |
111 | 111 |
--CONFIG-- |
112 | 112 |
return ['strict_variables' => true] |
... | ... |
@@ -25,7 +25,7 @@ |
25 | 25 |
--DATA-- |
26 | 26 |
return [ |
27 | 27 |
'it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), |
28 |
- 'ita' => new IteratorAggregateStub(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), |
|
28 |
+ 'ita' => new Twig\Tests\IteratorAggregateStub(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), |
|
29 | 29 |
] |
30 | 30 |
--EXPECT-- |
31 | 31 |
1 = 5 |
... | ... |
@@ -18,7 +18,7 @@ |
18 | 18 |
{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',') }} |
19 | 19 |
{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',','-') }} |
20 | 20 |
--DATA-- |
21 |
-return ['foo' => new TwigTestFoo(), 'bar' => new \ArrayObject([3, 4])] |
|
21 |
+return ['foo' => new Twig\Tests\TwigTestFoo(), 'bar' => new \ArrayObject([3, 4])] |
|
22 | 22 |
--EXPECT-- |
23 | 23 |
foo, bar |
24 | 24 |
1, 2 |
... | ... |
@@ -17,14 +17,14 @@ return [ |
17 | 17 |
'array' => [1, 4], |
18 | 18 |
'string' => 'foo', |
19 | 19 |
'number' => 1000, |
20 |
- 'to_string_able' => new ToStringStub('foobar'), |
|
21 |
- 'countable' => new CountableStub(42), /* also asserts we do *not* call __toString() */ |
|
22 |
- 'iterator_aggregate' => new IteratorAggregateStub(['a', 'b', 'c']), /* also asserts we do *not* call __toString() */ |
|
20 |
+ 'to_string_able' => new Twig\Tests\ToStringStub('foobar'), |
|
21 |
+ 'countable' => new Twig\Tests\CountableStub(42), /* also asserts we do *not* call __toString() */ |
|
22 |
+ 'iterator_aggregate' => new Twig\Tests\IteratorAggregateStub(['a', 'b', 'c']), /* also asserts we do *not* call __toString() */ |
|
23 | 23 |
'null' => null, |
24 |
- 'magic' => new MagicCallStub(), /* used to assert we do *not* call __call */ |
|
24 |
+ 'magic' => new Twig\Tests\MagicCallStub(), /* used to assert we do *not* call __call */ |
|
25 | 25 |
'non_countable' => new \StdClass(), |
26 | 26 |
'simple_xml_element' => new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><doc><elem/><elem/></doc>'), |
27 |
- 'iterator' => new \SimpleIteratorForTesting() |
|
27 |
+ 'iterator' => new Twig\Tests\SimpleIteratorForTesting() |
|
28 | 28 |
] |
29 | 29 |
--EXPECT-- |
30 | 30 |
2 |
... | ... |
@@ -8,7 +8,7 @@ |
8 | 8 |
{{ attribute(obj, method) is defined ? 'ok' : 'ko' }} |
9 | 9 |
{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} |
10 | 10 |
--DATA-- |
11 |
-return ['obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] |
|
11 |
+return ['obj' => new Twig\Tests\TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] |
|
12 | 12 |
--EXPECT-- |
13 | 13 |
foo |
14 | 14 |
bar |
... | ... |
@@ -2,8 +2,8 @@ |
2 | 2 |
"const" test |
3 | 3 |
--TEMPLATE-- |
4 | 4 |
{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} |
5 |
-{{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} |
|
6 |
-{{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} |
|
5 |
+{{ 'bar' is constant('Twig\\Tests\\TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} |
|
6 |
+{{ value is constant('Twig\\Tests\\TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} |
|
7 | 7 |
{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }} |
8 | 8 |
--DATA-- |
9 | 9 |
return ['value' => 'bar', 'object' => new \ArrayObject(['hi'])] |
... | ... |
@@ -44,7 +44,7 @@ return [ |
44 | 44 |
'nullVar' => null, |
45 | 45 |
'definedArray' => [0], |
46 | 46 |
], |
47 |
- 'object' => new TwigTestFoo(), |
|
47 |
+ 'object' => new Twig\Tests\TwigTestFoo(), |
|
48 | 48 |
] |
49 | 49 |
--EXPECT-- |
50 | 50 |
ok |
... | ... |
@@ -90,7 +90,7 @@ return [ |
90 | 90 |
'nullVar' => null, |
91 | 91 |
'definedArray' => [0], |
92 | 92 |
], |
93 |
- 'object' => new TwigTestFoo(), |
|
93 |
+ 'object' => new Twig\Tests\TwigTestFoo(), |
|
94 | 94 |
] |
95 | 95 |
--CONFIG-- |
96 | 96 |
return ['strict_variables' => false] |
... | ... |
@@ -20,9 +20,9 @@ return [ |
20 | 20 |
'string_empty' => '', 'string_zero' => '0', |
21 | 21 |
'value_null' => null, 'value_false' => false, 'value_int_zero' => 0, |
22 | 22 |
'array_empty' => [], 'array_not_empty' => [1, 2], |
23 |
- 'magically_callable' => new MagicCallStub(), |
|
24 |
- 'countable_empty' => new CountableStub([]), 'countable_not_empty' => new CountableStub([1, 2]), |
|
25 |
- 'tostring_empty' => new ToStringStub(''), 'tostring_not_empty' => new ToStringStub('0' /* edge case of using "0" as the string */), |
|
23 |
+ 'magically_callable' => new \Twig\Tests\MagicCallStub(), |
|
24 |
+ 'countable_empty' => new \Twig\Tests\CountableStub([]), 'countable_not_empty' => new \Twig\Tests\CountableStub([1, 2]), |
|
25 |
+ 'tostring_empty' => new \Twig\Tests\ToStringStub(''), 'tostring_not_empty' => new \Twig\Tests\ToStringStub('0' /* edge case of using "0" as the string */), |
|
26 | 26 |
'markup_empty' => new \Twig\Markup('', 'UTF-8'), 'markup_not_empty' => new \Twig\Markup('test', 'UTF-8'), |
27 | 27 |
] |
28 | 28 |
--EXPECT-- |
... | ... |
@@ -5,8 +5,8 @@ Twig supports the in operator when using objects |
5 | 5 |
TRUE |
6 | 6 |
{% endif %} |
7 | 7 |
--DATA-- |
8 |
-$foo = new TwigTestFoo(); |
|
9 |
-$foo1 = new TwigTestFoo(); |
|
8 |
+$foo = new Twig\Tests\TwigTestFoo(); |
|
9 |
+$foo1 = new Twig\Tests\TwigTestFoo(); |
|
10 | 10 |
|
11 | 11 |
$foo->position = $foo1; |
12 | 12 |
$foo1->position = $foo; |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -30,7 +32,7 @@ function html() |
30 | 32 |
return 'foo'; |
31 | 33 |
} |
32 | 34 |
|
33 |
-class Twig_Tests_IntegrationTest extends IntegrationTestCase |
|
35 |
+class IntegrationTest extends IntegrationTestCase |
|
34 | 36 |
{ |
35 | 37 |
public function getExtensions() |
36 | 38 |
{ |
... | ... |
@@ -55,7 +57,7 @@ function test_foo($value = 'foo') |
55 | 57 |
return $value; |
56 | 58 |
} |
57 | 59 |
|
58 |
-class TwigTestFoo implements Iterator |
|
60 |
+class TwigTestFoo implements \Iterator |
|
59 | 61 |
{ |
60 | 62 |
const BAR_NAME = 'bar'; |
61 | 63 |
|
... | ... |
@@ -155,11 +157,11 @@ class TwigTestExtension extends AbstractExtension |
155 | 157 |
new TwigFilter('nl2br', [$this, 'nl2br'], ['pre_escape' => 'html', 'is_safe' => ['html']]), |
156 | 158 |
new TwigFilter('escape_something', [$this, 'escape_something'], ['is_safe' => ['something']]), |
157 | 159 |
new TwigFilter('preserves_safety', [$this, 'preserves_safety'], ['preserves_safety' => ['html']]), |
158 |
- new TwigFilter('static_call_string', 'TwigTestExtension::staticCall'), |
|
159 |
- new TwigFilter('static_call_array', ['TwigTestExtension', 'staticCall']), |
|
160 |
+ new TwigFilter('static_call_string', 'Twig\Tests\TwigTestExtension::staticCall'), |
|
161 |
+ new TwigFilter('static_call_array', ['Twig\Tests\TwigTestExtension', 'staticCall']), |
|
160 | 162 |
new TwigFilter('magic_call', [$this, 'magicCall']), |
161 |
- new TwigFilter('magic_call_string', 'TwigTestExtension::magicStaticCall'), |
|
162 |
- new TwigFilter('magic_call_array', ['TwigTestExtension', 'magicStaticCall']), |
|
163 |
+ new TwigFilter('magic_call_string', 'Twig\Tests\TwigTestExtension::magicStaticCall'), |
|
164 |
+ new TwigFilter('magic_call_array', ['Twig\Tests\TwigTestExtension', 'magicStaticCall']), |
|
163 | 165 |
new TwigFilter('*_path', [$this, 'dynamic_path']), |
164 | 166 |
new TwigFilter('*_foo_*_bar', [$this, 'dynamic_foo']), |
165 | 167 |
]; |
... | ... |
@@ -171,8 +173,8 @@ class TwigTestExtension extends AbstractExtension |
171 | 173 |
new TwigFunction('§', [$this, '§Function']), |
172 | 174 |
new TwigFunction('safe_br', [$this, 'br'], ['is_safe' => ['html']]), |
173 | 175 |
new TwigFunction('unsafe_br', [$this, 'br']), |
174 |
- new TwigFunction('static_call_string', 'TwigTestExtension::staticCall'), |
|
175 |
- new TwigFunction('static_call_array', ['TwigTestExtension', 'staticCall']), |
|
176 |
+ new TwigFunction('static_call_string', 'Twig\Tests\TwigTestExtension::staticCall'), |
|
177 |
+ new TwigFunction('static_call_array', ['Twig\Tests\TwigTestExtension', 'staticCall']), |
|
176 | 178 |
new TwigFunction('*_path', [$this, 'dynamic_path']), |
177 | 179 |
new TwigFunction('*_foo_*_bar', [$this, 'dynamic_foo']), |
178 | 180 |
]; |
... | ... |
@@ -346,7 +348,7 @@ class IteratorAggregateStub implements \IteratorAggregate |
346 | 348 |
} |
347 | 349 |
} |
348 | 350 |
|
349 |
-class SimpleIteratorForTesting implements Iterator |
|
351 |
+class SimpleIteratorForTesting implements \Iterator |
|
350 | 352 |
{ |
351 | 353 |
private $data = [1, 2, 3, 4, 5, 6, 7]; |
352 | 354 |
private $key = 0; |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -12,7 +14,7 @@ |
12 | 14 |
use Twig\Extension\AbstractExtension; |
13 | 15 |
use Twig\Test\IntegrationTestCase; |
14 | 16 |
|
15 |
-class Twig_Tests_LegacyIntegrationTest extends IntegrationTestCase |
|
17 |
+class LegacyIntegrationTest extends IntegrationTestCase |
|
16 | 18 |
{ |
17 | 19 |
public function getExtensions() |
18 | 20 |
{ |
... | ... |
@@ -41,7 +43,7 @@ class LegacyTwigTestExtension extends AbstractExtension |
41 | 43 |
public function getTests() |
42 | 44 |
{ |
43 | 45 |
return [ |
44 |
- 'multi word' => new Twig_Test_Method($this, 'is_multi_word'), |
|
46 |
+ 'multi word' => new \Twig_Test_Method($this, 'is_multi_word'), |
|
45 | 47 |
]; |
46 | 48 |
} |
47 | 49 |
|
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -14,7 +16,7 @@ use Twig\Lexer; |
14 | 16 |
use Twig\Source; |
15 | 17 |
use Twig\Token; |
16 | 18 |
|
17 |
-class Twig_Tests_LexerTest extends \PHPUnit\Framework\TestCase |
|
19 |
+class LexerTest extends \PHPUnit\Framework\TestCase |
|
18 | 20 |
{ |
19 | 21 |
/** |
20 | 22 |
* @group legacy |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Loader; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -11,7 +13,7 @@ |
11 | 13 |
|
12 | 14 |
use Twig\Loader\ArrayLoader; |
13 | 15 |
|
14 |
-class Twig_Tests_Loader_ArrayTest extends \PHPUnit\Framework\TestCase |
|
16 |
+class ArrayTest extends \PHPUnit\Framework\TestCase |
|
15 | 17 |
{ |
16 | 18 |
/** |
17 | 19 |
* @group legacy |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Loader; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -17,7 +19,7 @@ use Twig\Loader\LoaderInterface; |
17 | 19 |
use Twig\Loader\SourceContextLoaderInterface; |
18 | 20 |
use Twig\Source; |
19 | 21 |
|
20 |
-class Twig_Tests_Loader_ChainTest extends \PHPUnit\Framework\TestCase |
|
22 |
+class ChainTest extends \PHPUnit\Framework\TestCase |
|
21 | 23 |
{ |
22 | 24 |
/** |
23 | 25 |
* @group legacy |
... | ... |
@@ -106,12 +108,12 @@ class Twig_Tests_Loader_ChainTest extends \PHPUnit\Framework\TestCase |
106 | 108 |
|
107 | 109 |
public function testExists() |
108 | 110 |
{ |
109 |
- $loader1 = $this->getMockBuilder('Twig_ChainTestLoaderWithExistsInterface')->getMock(); |
|
111 |
+ $loader1 = $this->getMockBuilder('Twig\Tests\Loader\ChainTestLoaderWithExistsInterface')->getMock(); |
|
110 | 112 |
$loader1->expects($this->once())->method('exists')->willReturn(false); |
111 | 113 |
$loader1->expects($this->never())->method('getSourceContext'); |
112 | 114 |
|
113 | 115 |
// can be removed in 2.0 |
114 |
- $loader2 = $this->getMockBuilder('Twig_ChainTestLoaderInterface')->getMock(); |
|
116 |
+ $loader2 = $this->getMockBuilder('Twig\Tests\Loader\ChainTestLoaderInterface')->getMock(); |
|
115 | 117 |
//$loader2 = $this->getMockBuilder(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface'])->getMock(); |
116 | 118 |
$loader2->expects($this->once())->method('getSourceContext')->willReturn(new Source('content', 'index')); |
117 | 119 |
|
... | ... |
@@ -123,10 +125,10 @@ class Twig_Tests_Loader_ChainTest extends \PHPUnit\Framework\TestCase |
123 | 125 |
} |
124 | 126 |
} |
125 | 127 |
|
126 |
-interface Twig_ChainTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface |
|
128 |
+interface ChainTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface |
|
127 | 129 |
{ |
128 | 130 |
} |
129 | 131 |
|
130 |
-interface Twig_ChainTestLoaderWithExistsInterface extends LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface |
|
132 |
+interface ChainTestLoaderWithExistsInterface extends LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface |
|
131 | 133 |
{ |
132 | 134 |
} |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Loader; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Environment; |
13 | 15 |
use Twig\Error\LoaderError; |
14 | 16 |
use Twig\Loader\FilesystemLoader; |
15 | 17 |
|
16 |
-class Twig_Tests_Loader_FilesystemTest extends \PHPUnit\Framework\TestCase |
|
18 |
+class FilesystemTest extends \PHPUnit\Framework\TestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testGetSourceContext() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,9 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests; |
|
4 |
+ |
|
5 |
+namespace Twig\Tests; |
|
6 |
+ |
|
3 | 7 |
/* |
4 | 8 |
* This file is part of Twig. |
5 | 9 |
* |
... | ... |
@@ -12,7 +16,7 @@ |
12 | 16 |
use Twig\Environment; |
13 | 17 |
use Twig\Loader\ArrayLoader; |
14 | 18 |
|
15 |
-class Twig_Tests_NativeExtensionTest extends \PHPUnit\Framework\TestCase |
|
19 |
+class NativeExtensionTest extends \PHPUnit\Framework\TestCase |
|
16 | 20 |
{ |
17 | 21 |
/** |
18 | 22 |
* @requires PHP 5.3 |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -14,7 +16,7 @@ use Twig\Node\Node; |
14 | 16 |
use Twig\Node\TextNode; |
15 | 17 |
use Twig\Test\NodeTestCase; |
16 | 18 |
|
17 |
-class Twig_Tests_Node_AutoEscapeTest extends NodeTestCase |
|
19 |
+class AutoEscapeTest extends NodeTestCase |
|
18 | 20 |
{ |
19 | 21 |
public function testConstructor() |
20 | 22 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -12,7 +14,7 @@ |
12 | 14 |
use Twig\Node\BlockReferenceNode; |
13 | 15 |
use Twig\Test\NodeTestCase; |
14 | 16 |
|
15 |
-class Twig_Tests_Node_BlockReferenceTest extends NodeTestCase |
|
17 |
+class BlockReferenceTest extends NodeTestCase |
|
16 | 18 |
{ |
17 | 19 |
public function testConstructor() |
18 | 20 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\BlockNode; |
13 | 15 |
use Twig\Node\TextNode; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_BlockTest extends NodeTestCase |
|
18 |
+class BlockTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -18,7 +20,7 @@ use Twig\Node\Node; |
18 | 20 |
use Twig\Test\NodeTestCase; |
19 | 21 |
use Twig\TwigFunction; |
20 | 22 |
|
21 |
-class Twig_Tests_Node_DeprecatedTest extends NodeTestCase |
|
23 |
+class DeprecatedTest extends NodeTestCase |
|
22 | 24 |
{ |
23 | 25 |
public function testConstructor() |
24 | 26 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\DoNode; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_DoTest extends NodeTestCase |
|
18 |
+class DoTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\ArrayExpression; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_ArrayTest extends NodeTestCase |
|
18 |
+class ArrayTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -12,7 +14,7 @@ |
12 | 14 |
use Twig\Node\Expression\AssignNameExpression; |
13 | 15 |
use Twig\Test\NodeTestCase; |
14 | 16 |
|
15 |
-class Twig_Tests_Node_Expression_AssignNameTest extends NodeTestCase |
|
17 |
+class AssignNameTest extends NodeTestCase |
|
16 | 18 |
{ |
17 | 19 |
public function testConstructor() |
18 | 20 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\AddBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_AddTest extends NodeTestCase |
|
18 |
+class AddTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\AndBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_AndTest extends NodeTestCase |
|
18 |
+class AndTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\ConcatBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_ConcatTest extends NodeTestCase |
|
18 |
+class ConcatTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\DivBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_DivTest extends NodeTestCase |
|
18 |
+class DivTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\FloorDivBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_FloorDivTest extends NodeTestCase |
|
18 |
+class FloorDivTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\ModBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_ModTest extends NodeTestCase |
|
18 |
+class ModTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\MulBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_MulTest extends NodeTestCase |
|
18 |
+class MulTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\OrBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_OrTest extends NodeTestCase |
|
18 |
+class OrTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression\Binary; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -13,7 +15,7 @@ use Twig\Node\Expression\Binary\SubBinary; |
13 | 15 |
use Twig\Node\Expression\ConstantExpression; |
14 | 16 |
use Twig\Test\NodeTestCase; |
15 | 17 |
|
16 |
-class Twig_Tests_Node_Expression_Binary_SubTest extends NodeTestCase |
|
18 |
+class SubTest extends NodeTestCase |
|
17 | 19 |
{ |
18 | 20 |
public function testConstructor() |
19 | 21 |
{ |
... | ... |
@@ -1,5 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
|
3 |
+namespace Twig\Tests\Node\Expression; |
|
4 |
+ |
|
3 | 5 |
/* |
4 | 6 |
* This file is part of Twig. |
5 | 7 |
* |
... | ... |
@@ -11,11 +13,11 @@ |
11 | 13 |
|
12 | 14 |
use Twig\Node\Expression\CallExpression; |
13 | 15 |
|
14 |
-class Twig_Tests_Node_Expression_CallTest extends \PHPUnit\Framework\TestCase |
|
16 |
+class CallTest extends \PHPUnit\Framework\TestCase |
|
15 | 17 |
{ |
16 | 18 |
public function testGetArguments() |
17 | 19 |
{ |
18 |
- $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); |
|
20 |
+ $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); |
|
19 | 21 |
$this->assertEquals(['U', null], $node->getArguments('date', ['format' => 'U', 'timestamp' => null])); |
20 | 22 |
} |
21 | 23 |
|
... | ... |
@@ -25,7 +27,7 @@ class Twig_Tests_Node_Expression_CallTest extends \PHPUnit\Framework\TestCase |
25 | 27 |
*/ |
26 | 28 |
public function testGetArgumentsWhenPositionalArgumentsAfterNamedArguments() |
27 | 29 |
{ |
28 |
- $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); |
|
30 |
+ $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); |
|
29 | 31 |
$node->getArguments('date', ['timestamp' => 123456, 'Y-m-d']); |
30 | 32 |
} |
31 | 33 |
|
... | ... |
@@ -35,7 +37,7 @@ class Twig_Tests_Node_Expression_CallTest extends \PHPUnit\Framework\TestCase |
35 | 37 |
*/ |
36 | 38 |
public function testGetArgumentsWhenArgumentIsDefinedTwice() |
37 | 39 |
{ |