Various tweaks 3.4

This commit is contained in:
Fabien Potencier 2019-09-23 21:33:12 +02:00
parent 35b670112c
commit 47cb83a6ec
11 changed files with 12 additions and 14 deletions

View File

@ -960,7 +960,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

@ -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;
@ -17,6 +17,7 @@ use Symfony\Component\Ldap\Adapter\ExtLdap\Query;
use Symfony\Component\Ldap\Entry; use Symfony\Component\Ldap\Entry;
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,13 +9,14 @@
* 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;
use Symfony\Component\Ldap\Entry; 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\Tests\LdapTestCase;
/** /**
* @requires extension ldap * @requires extension ldap

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');