Skip to content

Commit eef8814

Browse files
committed
Fix tests
1 parent 116c7f0 commit eef8814

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ matrix:
2525
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-clover=coverage.clover"
2626

2727
# Install all SF components in the same major version, see https://github.com/dunglas/symfony-lock
28-
- php: 7.3
29-
env: SYMFONY_VERSION="^4"
28+
- php: 7.4
29+
env: DEPENDENCIES="symfony/flex" SYMFONY_VERSION="^3.4"
30+
- php: 7.4
31+
env: DEPENDENCIES="symfony/flex" SYMFONY_VERSION="^4.4"
3032

3133
before_install:
3234
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
3335

3436
install:
3537
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
3638
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
37-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update dunglas/symfony-lock=$SYMFONY_VERSION; fi;
39+
- if [ "$DEPENDENCIES" != "" ]; then composer require --no-update ${DEPENDENCIES}; fi;
40+
- if [ "$SYMFONY_VERSION" != "" ]; then composer config extra.symfony.require ${SYMFONY_VERSION}; fi;
3841
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
3942
- mkdir /tmp/elasticsearch
4043
- wget -O - https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz | tar xz --directory=/tmp/elasticsearch --strip-components=1

tests/Functional/ProfilerTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
use Symfony\Component\HttpFoundation\Request;
2222
use Symfony\Component\HttpFoundation\Response;
2323
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
24+
use Twig\Loader\FilesystemLoader;
25+
use Twig\Environment;
26+
use Twig\RuntimeLoader\RuntimeLoaderInterface;
2427

2528
/**
2629
* @group functional
@@ -30,7 +33,7 @@ class ProfilerTest extends WebTestCase
3033
/** @var ElasticaLogger */
3134
private $logger;
3235

33-
/** @var \Twig_Environment */
36+
/** @var Environment */
3437
private $twig;
3538

3639
/** @var ElasticaDataCollector */
@@ -41,15 +44,15 @@ public function setUp()
4144
$this->logger = new ElasticaLogger($this->createMock(LoggerInterface::class), true);
4245
$this->collector = new ElasticaDataCollector($this->logger);
4346

44-
$twigLoaderFilesystem = new \Twig_Loader_Filesystem(__DIR__ . '/../../src/Resources/views/Collector');
47+
$twigLoaderFilesystem = new FilesystemLoader(__DIR__ . '/../../src/Resources/views/Collector');
4548
$twigLoaderFilesystem->addPath(__DIR__ . '/../../vendor/symfony/web-profiler-bundle/Resources/views', 'WebProfiler');
46-
$this->twig = new \Twig_Environment($twigLoaderFilesystem, ['debug' => true, 'strict_variables' => true]);
49+
$this->twig = new Environment($twigLoaderFilesystem, ['debug' => true, 'strict_variables' => true]);
4750

4851
$this->twig->addExtension(new CodeExtension('', '', ''));
4952
$this->twig->addExtension(new RoutingExtension($this->getMockBuilder(UrlGeneratorInterface::class)->getMock()));
5053
$this->twig->addExtension(new HttpKernelExtension($this->getMockBuilder(FragmentHandler::class)->disableOriginalConstructor()->getMock()));
5154

52-
$loader = $this->getMockBuilder(\Twig_RuntimeLoaderInterface::class)->getMock();
55+
$loader = $this->getMockBuilder(RuntimeLoaderInterface::class)->getMock();
5356
$loader->method('load')->willReturn($this->getMockBuilder(HttpKernelRuntime::class)->disableOriginalConstructor()->getMock());
5457
$this->twig->addRuntimeLoader($loader);
5558
}

0 commit comments

Comments
 (0)