Merge branch '3.4' into 4.3

* 3.4:
  Various tweaks 3.4
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
This commit is contained in:
Nicolas Grekas 2019-09-24 17:54:14 +02:00
commit 7031e83a8f
20 changed files with 51 additions and 55 deletions

View File

@ -53,12 +53,10 @@ class ClockMock
public static function usleep($us) public static function usleep($us)
{ {
if (null === self::$now) { if (null === self::$now) {
return \usleep($us); \usleep($us);
} else {
self::$now += $us / 1000000;
} }
self::$now += $us / 1000000;
return null;
} }
public static function microtime($asFloat = false) public static function microtime($asFloat = false)
@ -127,7 +125,7 @@ function sleep(\$s)
function usleep(\$us) function usleep(\$us)
{ {
return \\$self::usleep(\$us); \\$self::usleep(\$us);
} }
function date(\$format, \$timestamp = null) function date(\$format, \$timestamp = null)

View File

@ -19,9 +19,9 @@ class RedisAdapter extends AbstractAdapter
use RedisTrait; use RedisTrait;
/** /**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient The redis client * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redisClient The redis client
* @param string $namespace The default namespace * @param string $namespace The default namespace
* @param int $defaultLifetime The default lifetime * @param int $defaultLifetime The default lifetime
*/ */
public function __construct($redisClient, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) public function __construct($redisClient, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
{ {

View File

@ -70,9 +70,9 @@ class RedisTagAwareAdapter extends AbstractTagAwareAdapter
private $redisServerSupportSPOP = null; private $redisServerSupportSPOP = null;
/** /**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient The redis client * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redisClient The redis client
* @param string $namespace The default namespace * @param string $namespace The default namespace
* @param int $defaultLifetime The default lifetime * @param int $defaultLifetime The default lifetime
* *
* @throws \Symfony\Component\Cache\Exception\LogicException If phpredis with version lower than 3.1.3. * @throws \Symfony\Component\Cache\Exception\LogicException If phpredis with version lower than 3.1.3.
*/ */
@ -81,7 +81,7 @@ class RedisTagAwareAdapter extends AbstractTagAwareAdapter
$this->init($redisClient, $namespace, $defaultLifetime, $marshaller); $this->init($redisClient, $namespace, $defaultLifetime, $marshaller);
// Make sure php-redis is 3.1.3 or higher configured for Redis classes // Make sure php-redis is 3.1.3 or higher configured for Redis classes
if (!$this->redis instanceof Predis\Client && version_compare(phpversion('redis'), '3.1.3', '<')) { if (!$this->redis instanceof \Predis\ClientInterface && version_compare(phpversion('redis'), '3.1.3', '<')) {
throw new LogicException('RedisTagAwareAdapter requires php-redis 3.1.3 or higher, alternatively use predis/predis'); throw new LogicException('RedisTagAwareAdapter requires php-redis 3.1.3 or higher, alternatively use predis/predis');
} }
} }
@ -140,7 +140,7 @@ class RedisTagAwareAdapter extends AbstractTagAwareAdapter
return true; return true;
} }
$predisCluster = $this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface; $predisCluster = $this->redis instanceof \Predis\ClientInterface && $this->redis->getConnection() instanceof ClusterInterface;
$this->pipeline(static function () use ($ids, $tagData, $predisCluster) { $this->pipeline(static function () use ($ids, $tagData, $predisCluster) {
if ($predisCluster) { if ($predisCluster) {
foreach ($ids as $id) { foreach ($ids as $id) {

View File

@ -26,7 +26,7 @@ class RedisCache extends AbstractCache
use RedisTrait; use RedisTrait;
/** /**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redisClient
*/ */
public function __construct($redisClient, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null) public function __construct($redisClient, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
{ {

View File

@ -45,7 +45,7 @@ trait RedisTrait
private $marshaller; private $marshaller;
/** /**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redisClient
*/ */
private function init($redisClient, $namespace, $defaultLifetime, ?MarshallerInterface $marshaller) private function init($redisClient, $namespace, $defaultLifetime, ?MarshallerInterface $marshaller)
{ {
@ -54,8 +54,8 @@ trait RedisTrait
if (preg_match('#[^-+_.A-Za-z0-9]#', $namespace, $match)) { if (preg_match('#[^-+_.A-Za-z0-9]#', $namespace, $match)) {
throw new InvalidArgumentException(sprintf('RedisAdapter namespace contains "%s" but only characters in [-+_.A-Za-z0-9] are allowed.', $match[0])); throw new InvalidArgumentException(sprintf('RedisAdapter namespace contains "%s" but only characters in [-+_.A-Za-z0-9] are allowed.', $match[0]));
} }
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\Client && !$redisClient instanceof RedisProxy && !$redisClient instanceof RedisClusterProxy) { if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\ClientInterface && !$redisClient instanceof RedisProxy && !$redisClient instanceof RedisClusterProxy) {
throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given.', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient))); throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given.', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient)));
} }
$this->redis = $redisClient; $this->redis = $redisClient;
$this->marshaller = $marshaller ?? new DefaultMarshaller(); $this->marshaller = $marshaller ?? new DefaultMarshaller();
@ -76,7 +76,7 @@ trait RedisTrait
* *
* @throws InvalidArgumentException when the DSN is invalid * @throws InvalidArgumentException when the DSN is invalid
* *
* @return \Redis|\RedisCluster|\Predis\Client According to the "class" option * @return \Redis|\RedisCluster|\Predis\ClientInterface According to the "class" option
*/ */
public static function createConnection($dsn, array $options = []) public static function createConnection($dsn, array $options = [])
{ {
@ -243,7 +243,7 @@ trait RedisTrait
}; };
$redis = $params['lazy'] ? new RedisClusterProxy($initializer) : $initializer(); $redis = $params['lazy'] ? new RedisClusterProxy($initializer) : $initializer();
} elseif (is_a($class, \Predis\Client::class, true)) { } elseif (is_a($class, \Predis\ClientInterface::class, true)) {
if ($params['redis_cluster']) { if ($params['redis_cluster']) {
$params['cluster'] = 'redis'; $params['cluster'] = 'redis';
} }
@ -269,7 +269,7 @@ trait RedisTrait
$redis = new $class($hosts, array_diff_key($params, self::$defaultConnectionOptions)); $redis = new $class($hosts, array_diff_key($params, self::$defaultConnectionOptions));
} elseif (class_exists($class, false)) { } elseif (class_exists($class, false)) {
throw new InvalidArgumentException(sprintf('"%s" is not a subclass of "Redis", "RedisArray", "RedisCluster" nor "Predis\Client".', $class)); throw new InvalidArgumentException(sprintf('"%s" is not a subclass of "Redis", "RedisArray", "RedisCluster" nor "Predis\ClientInterface".', $class));
} else { } else {
throw new InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); throw new InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
} }
@ -288,7 +288,7 @@ trait RedisTrait
$result = []; $result = [];
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) { if ($this->redis instanceof \Predis\ClientInterface && $this->redis->getConnection() instanceof ClusterInterface) {
$values = $this->pipeline(function () use ($ids) { $values = $this->pipeline(function () use ($ids) {
foreach ($ids as $id) { foreach ($ids as $id) {
yield 'get' => [$id]; yield 'get' => [$id];
@ -321,7 +321,7 @@ trait RedisTrait
protected function doClear($namespace) protected function doClear($namespace)
{ {
$cleared = true; $cleared = true;
if ($this->redis instanceof \Predis\Client) { if ($this->redis instanceof \Predis\ClientInterface) {
$evalArgs = [0, $namespace]; $evalArgs = [0, $namespace];
} else { } else {
$evalArgs = [[$namespace], 0]; $evalArgs = [[$namespace], 0];
@ -346,7 +346,7 @@ trait RedisTrait
$cursor = null; $cursor = null;
do { do {
$keys = $host instanceof \Predis\Client ? $host->scan($cursor, 'MATCH', $namespace.'*', 'COUNT', 1000) : $host->scan($cursor, $namespace.'*', 1000); $keys = $host instanceof \Predis\ClientInterface ? $host->scan($cursor, 'MATCH', $namespace.'*', 'COUNT', 1000) : $host->scan($cursor, $namespace.'*', 1000);
if (isset($keys[1]) && \is_array($keys[1])) { if (isset($keys[1]) && \is_array($keys[1])) {
$cursor = $keys[0]; $cursor = $keys[0];
$keys = $keys[1]; $keys = $keys[1];
@ -369,7 +369,7 @@ trait RedisTrait
return true; return true;
} }
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) { if ($this->redis instanceof \Predis\ClientInterface && $this->redis->getConnection() instanceof ClusterInterface) {
$this->pipeline(function () use ($ids) { $this->pipeline(function () use ($ids) {
foreach ($ids as $id) { foreach ($ids as $id) {
yield 'del' => [$id]; yield 'del' => [$id];
@ -413,7 +413,7 @@ trait RedisTrait
{ {
$ids = []; $ids = [];
if ($this->redis instanceof RedisClusterProxy || $this->redis instanceof \RedisCluster || ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof RedisCluster)) { if ($this->redis instanceof RedisClusterProxy || $this->redis instanceof \RedisCluster || ($this->redis instanceof \Predis\ClientInterface && $this->redis->getConnection() instanceof RedisCluster)) {
// phpredis & predis don't support pipelining with RedisCluster // phpredis & predis don't support pipelining with RedisCluster
// see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining // see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining
// see https://github.com/nrk/predis/issues/267#issuecomment-123781423 // see https://github.com/nrk/predis/issues/267#issuecomment-123781423
@ -422,7 +422,7 @@ trait RedisTrait
$results[] = $this->redis->{$command}(...$args); $results[] = $this->redis->{$command}(...$args);
$ids[] = $args[0]; $ids[] = $args[0];
} }
} elseif ($this->redis instanceof \Predis\Client) { } elseif ($this->redis instanceof \Predis\ClientInterface) {
$results = $this->redis->pipeline(function ($redis) use ($generator, &$ids) { $results = $this->redis->pipeline(function ($redis) use ($generator, &$ids) {
foreach ($generator() as $command => $args) { foreach ($generator() as $command => $args) {
$redis->{$command}(...$args); $redis->{$command}(...$args);
@ -463,7 +463,7 @@ trait RedisTrait
private function getHosts(): array private function getHosts(): array
{ {
$hosts = [$this->redis]; $hosts = [$this->redis];
if ($this->redis instanceof \Predis\Client) { if ($this->redis instanceof \Predis\ClientInterface) {
$connection = $this->redis->getConnection(); $connection = $this->redis->getConnection();
if ($connection instanceof ClusterInterface && $connection instanceof \Traversable) { if ($connection instanceof ClusterInterface && $connection instanceof \Traversable) {
$hosts = []; $hosts = [];

View File

@ -652,7 +652,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
$dialog = new QuestionHelper(); $dialog = new QuestionHelper();
$question = new Question('What\'s your name?'); $question = new Question('What\'s your name?');
$question->setValidator(function () { $question->setValidator(function ($value) {
if (!$value) { if (!$value) {
throw new \Exception('A value is required.'); throw new \Exception('A value is required.');
} }

View File

@ -20,6 +20,7 @@ class InputDefinitionTest extends TestCase
{ {
protected static $fixtures; protected static $fixtures;
protected $multi;
protected $foo; protected $foo;
protected $bar; protected $bar;
protected $foo1; protected $foo1;

View File

@ -196,7 +196,7 @@ class CommandTesterTest extends TestCase
]; ];
$command = new Command('foo'); $command = new Command('foo');
$command->setCode(function ($input, $output) use ($questions, $command) { $command->setCode(function ($input, $output) use ($questions) {
$io = new SymfonyStyle($input, $output); $io = new SymfonyStyle($input, $output);
$io->ask($questions[0]); $io->ask($questions[0]);
$io->ask($questions[1]); $io->ask($questions[1]);

View File

@ -34,8 +34,8 @@ class RedisSessionHandler extends AbstractSessionHandler
* List of available options: * List of available options:
* * prefix: The prefix to use for the keys in order to avoid collision on the Redis server. * * prefix: The prefix to use for the keys in order to avoid collision on the Redis server.
* *
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client|RedisProxy $redis * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|RedisProxy $redis
* @param array $options An associative array of options * @param array $options An associative array of options
* *
* @throws \InvalidArgumentException When unsupported client or options are passed * @throws \InvalidArgumentException When unsupported client or options are passed
*/ */
@ -45,11 +45,11 @@ class RedisSessionHandler extends AbstractSessionHandler
!$redis instanceof \Redis && !$redis instanceof \Redis &&
!$redis instanceof \RedisArray && !$redis instanceof \RedisArray &&
!$redis instanceof \RedisCluster && !$redis instanceof \RedisCluster &&
!$redis instanceof \Predis\Client && !$redis instanceof \Predis\ClientInterface &&
!$redis instanceof RedisProxy && !$redis instanceof RedisProxy &&
!$redis instanceof RedisClusterProxy !$redis instanceof RedisClusterProxy
) { ) {
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis))); throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
} }
if ($diff = array_diff(array_keys($options), ['prefix'])) { if ($diff = array_diff(array_keys($options), ['prefix'])) {

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Symfony\Component\Ldap\Tests; namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap;
use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter; use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter;
use Symfony\Component\Ldap\Adapter\ExtLdap\Collection; use Symfony\Component\Ldap\Adapter\ExtLdap\Collection;
@ -18,6 +18,7 @@ use Symfony\Component\Ldap\Entry;
use Symfony\Component\Ldap\Exception\LdapException; use Symfony\Component\Ldap\Exception\LdapException;
use Symfony\Component\Ldap\Exception\NotBoundException; use Symfony\Component\Ldap\Exception\NotBoundException;
use Symfony\Component\Ldap\LdapInterface; use Symfony\Component\Ldap\LdapInterface;
use Symfony\Component\Ldap\Tests\LdapTestCase;
/** /**
* @requires extension ldap * @requires extension ldap

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Symfony\Component\Ldap\Tests; namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap;
use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter; use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter;
use Symfony\Component\Ldap\Adapter\ExtLdap\Collection; use Symfony\Component\Ldap\Adapter\ExtLdap\Collection;
@ -18,6 +18,7 @@ use Symfony\Component\Ldap\Entry;
use Symfony\Component\Ldap\Exception\LdapException; use Symfony\Component\Ldap\Exception\LdapException;
use Symfony\Component\Ldap\Exception\NotBoundException; use Symfony\Component\Ldap\Exception\NotBoundException;
use Symfony\Component\Ldap\Exception\UpdateOperationException; use Symfony\Component\Ldap\Exception\UpdateOperationException;
use Symfony\Component\Ldap\Tests\LdapTestCase;
/** /**
* @requires extension ldap * @requires extension ldap

View File

@ -32,13 +32,13 @@ class RedisStore implements StoreInterface
private $initialTtl; private $initialTtl;
/** /**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redisClient
* @param float $initialTtl the expiration delay of locks in seconds * @param float $initialTtl the expiration delay of locks in seconds
*/ */
public function __construct($redisClient, float $initialTtl = 300.0) public function __construct($redisClient, float $initialTtl = 300.0)
{ {
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\Client && !$redisClient instanceof RedisProxy) { if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\ClientInterface && !$redisClient instanceof RedisProxy) {
throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient))); throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient)));
} }
if ($initialTtl <= 0) { if ($initialTtl <= 0) {
@ -145,11 +145,11 @@ class RedisStore implements StoreInterface
return $this->redis->_instance($this->redis->_target($resource))->eval($script, array_merge([$resource], $args), 1); return $this->redis->_instance($this->redis->_target($resource))->eval($script, array_merge([$resource], $args), 1);
} }
if ($this->redis instanceof \Predis\Client) { if ($this->redis instanceof \Predis\ClientInterface) {
return $this->redis->eval(...array_merge([$script, 1, $resource], $args)); return $this->redis->eval(...array_merge([$script, 1, $resource], $args));
} }
throw new InvalidArgumentException(sprintf('%s() expects being initialized with a Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($this->redis) ? \get_class($this->redis) : \gettype($this->redis))); throw new InvalidArgumentException(sprintf('%s() expects being initialized with a Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($this->redis) ? \get_class($this->redis) : \gettype($this->redis)));
} }
private function getUniqueToken(Key $key): string private function getUniqueToken(Key $key): string

View File

@ -25,7 +25,7 @@ use Symfony\Component\Lock\StoreInterface;
class StoreFactory class StoreFactory
{ {
/** /**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client|\Memcached|\Zookeeper|string $connection Connection or DSN or Store short name * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|\Memcached|\Zookeeper|string $connection Connection or DSN or Store short name
* *
* @return StoreInterface * @return StoreInterface
*/ */
@ -35,7 +35,7 @@ class StoreFactory
$connection instanceof \Redis || $connection instanceof \Redis ||
$connection instanceof \RedisArray || $connection instanceof \RedisArray ||
$connection instanceof \RedisCluster || $connection instanceof \RedisCluster ||
$connection instanceof \Predis\Client || $connection instanceof \Predis\ClientInterface ||
$connection instanceof RedisProxy || $connection instanceof RedisProxy ||
$connection instanceof RedisClusterProxy $connection instanceof RedisClusterProxy
) { ) {

View File

@ -31,7 +31,7 @@ abstract class AbstractRedisStoreTest extends AbstractStoreTest
/** /**
* Return a RedisConnection. * Return a RedisConnection.
* *
* @return \Redis|\RedisArray|\RedisCluster|\Predis\Client * @return \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface
*/ */
abstract protected function getRedisConnection(); abstract protected function getRedisConnection();

View File

@ -40,7 +40,7 @@ class PhpFileLoader extends FileLoader
// the closure forbids access to the private scope in the included file // the closure forbids access to the private scope in the included file
$loader = $this; $loader = $this;
$load = \Closure::bind(static function ($file) use ($loader) { $load = \Closure::bind(static function ($file) {
return include $file; return include $file;
}, null, ProtectedPhpFileLoader::class); }, null, ProtectedPhpFileLoader::class);

View File

@ -165,7 +165,7 @@ class CsrfTokenManagerTest extends TestCase
$requestStack = new RequestStack(); $requestStack = new RequestStack();
$requestStack->push(new Request([], [], [], [], [], ['HTTPS' => 'on'])); $requestStack->push(new Request([], [], [], [], [], ['HTTPS' => 'on']));
$manager = new CsrfTokenManager($generator, $storage, null, $requestStack); $manager = new CsrfTokenManager($generator, $storage);
$token = $manager->getToken('foo'); $token = $manager->getToken('foo');
$this->assertSame('foo', $token->getId()); $this->assertSame('foo', $token->getId());

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Symfony\Component\Security\Tests\Http\Firewall; namespace Symfony\Component\Security\Http\Tests\Firewall;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Symfony\Component\Security\Tests\Http\Firewall; namespace Symfony\Component\Security\Http\Tests\Firewall;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -37,11 +37,6 @@ class ProjectTemplateLoader4 extends Loader
return $this->logger; return $this->logger;
} }
public function getDebugger()
{
return $this->debugger;
}
public function isFresh(TemplateReferenceInterface $template, $time) public function isFresh(TemplateReferenceInterface $template, $time)
{ {
return false; return false;

View File

@ -93,7 +93,7 @@ class PhpEngineTest extends TestCase
public function testExtendRender() public function testExtendRender()
{ {
$engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader, [], [new SlotsHelper()]); $engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader, []);
try { try {
$engine->render('name'); $engine->render('name');
$this->fail('->render() throws an InvalidArgumentException if the template does not exist'); $this->fail('->render() throws an InvalidArgumentException if the template does not exist');