Skip to content

Commit

Permalink
Use twig extension via lazy properties
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 21, 2021
1 parent efd0166 commit 196b17b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/Twig/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@

namespace XHGui\Test\Twig;

use Slim\App;
use Slim\Http\Environment;
use XHGui\Test\TestCase;
use XHGui\Twig\TwigExtension;

class ExtensionTest extends TestCase
{
/** @var TwigExtension */
private $ext;

public function setUp(): void
{
parent::setUp();
$app = new App();
$app->get('/test', function (): void {
$this->app->get('/test', function (): void {
})->setName('test');
$this->ext = new TwigExtension($app);
}

public function testFormatBytes(): void
Expand Down Expand Up @@ -101,7 +94,7 @@ public function testUrl($url, $query, $expected): void

public function testStaticUrlNoIndexPhp(): void
{
Environment::mock([
$this->env = Environment::mock([
'SCRIPT_NAME' => '/index.php',
'PHP_SELF' => '/index.php',
'REQUEST_URI' => '/',
Expand All @@ -112,7 +105,7 @@ public function testStaticUrlNoIndexPhp(): void

public function testStaticUrlWithIndexPhp(): void
{
Environment::mock([
$this->env = Environment::mock([
'SCRIPT_NAME' => '/xhgui/webroot/index.php',
'PHP_SELF' => '/xhgui/webroot/index.php/',
'REQUEST_URI' => '/xhgui/webroot/index.php/',
Expand Down

0 comments on commit 196b17b

Please sign in to comment.