minor #19466 Minor fixes (zomberg)

This PR was squashed before being merged into the 2.7 branch (closes #19466).

Discussion
----------

Minor fixes

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

774c984 Minor fixes
This commit is contained in:
Fabien Potencier 2016-07-30 03:17:27 -04:00
commit 2075d310b7
24 changed files with 15 additions and 42 deletions

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension; namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\Twig\Extension\ExpressionExtension; use Symfony\Bridge\Twig\Extension\ExpressionExtension;
use Symfony\Component\ExpressionLanguage\Expression;
class ExpressionExtensionTest extends \PHPUnit_Framework_TestCase class ExpressionExtensionTest extends \PHPUnit_Framework_TestCase
{ {

View File

@ -23,7 +23,6 @@ use Symfony\Component\Config\Resource\DirectoryResource;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
use Symfony\Component\Validator\Validation;
/** /**
* FrameworkExtension. * FrameworkExtension.

View File

@ -18,7 +18,6 @@ use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Loader\ClosureLoader; use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Validator\Validation;
abstract class FrameworkExtensionTest extends TestCase abstract class FrameworkExtensionTest extends TestCase
{ {

View File

@ -42,7 +42,7 @@ class SessionController extends ContainerAware
public function logoutAction(Request $request) public function logoutAction(Request $request)
{ {
$request->getSession('session')->invalidate(); $request->getSession()->invalidate();
return new Response('Session cleared.'); return new Response('Session cleared.');
} }

View File

@ -105,7 +105,7 @@ EOF
return 1; return 1;
} }
$passwordQuestion = $this->createPasswordQuestion($input, $output); $passwordQuestion = $this->createPasswordQuestion();
$password = $output->askQuestion($passwordQuestion); $password = $output->askQuestion($passwordQuestion);
} }

View File

@ -248,11 +248,6 @@ class LegacyDialogHelperTest extends \PHPUnit_Framework_TestCase
return $output; return $output;
} }
private function hasStderrSupport()
{
return false === $this->isRunningOS400();
}
private function hasSttyAvailable() private function hasSttyAvailable()
{ {
exec('stty 2>&1', $output, $exitcode); exec('stty 2>&1', $output, $exitcode);

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Debug\Tests;
use Symfony\Component\Debug\DebugClassLoader; use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\Exception\ContextErrorException;
class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
{ {

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Compiler; namespace Symfony\Component\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;

View File

@ -51,7 +51,7 @@ class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
$this->assertSame('b_alias', $aDefinition->getFactoryService(false)); $this->assertSame('b_alias', $aDefinition->getFactoryService(false));
$this->assertTrue($container->has('container')); $this->assertTrue($container->has('container'));
$resolvedFactory = $aDefinition->getFactory(false); $resolvedFactory = $aDefinition->getFactory();
$this->assertSame('b_alias', (string) $resolvedFactory[0]); $this->assertSame('b_alias', (string) $resolvedFactory[0]);
} }

View File

@ -100,7 +100,7 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
try { try {
@$builder->get('baz'); @$builder->get('baz');
$this->fail('->get() throws a ServiceCircularReferenceException if the service has a circular reference to itself'); $this->fail('->get() throws a ServiceCircularReferenceException if the service has a circular reference to itself');
} catch (\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException $e) { } catch (ServiceCircularReferenceException $e) {
$this->assertEquals('Circular reference detected for service "baz", path: "baz".', $e->getMessage(), '->get() throws a LogicException if the service has a circular reference to itself'); $this->assertEquals('Circular reference detected for service "baz", path: "baz".', $e->getMessage(), '->get() throws a LogicException if the service has a circular reference to itself');
} }

View File

@ -4,7 +4,6 @@ require_once __DIR__.'/../includes/classes.php';
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\ExpressionLanguage\Expression;
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$container-> $container->

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\DependencyInjection\Tests\Loader;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\DomCrawler\Tests;
use Symfony\Component\DomCrawler\Form; use Symfony\Component\DomCrawler\Form;
use Symfony\Component\DomCrawler\FormFieldRegistry; use Symfony\Component\DomCrawler\FormFieldRegistry;
use Symfony\Component\DomCrawler\Field;
class FormTest extends \PHPUnit_Framework_TestCase class FormTest extends \PHPUnit_Framework_TestCase
{ {

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Form\Tests\Extension\Core\Type; namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\Tests\Fixtures\Author; use Symfony\Component\Form\Tests\Fixtures\Author;
use Symfony\Component\Form\Tests\Fixtures\AuthorType; use Symfony\Component\Form\Tests\Fixtures\AuthorType;

View File

@ -58,7 +58,7 @@ class LegacyPdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
{ {
$storage = new LegacyPdoSessionHandler($this->pdo, array('db_table' => 'bad_name')); $storage = new LegacyPdoSessionHandler($this->pdo, array('db_table' => 'bad_name'));
$this->setExpectedException('RuntimeException'); $this->setExpectedException('RuntimeException');
$storage->read('foo', 'bar'); $storage->read('foo');
} }
public function testWriteRead() public function testWriteRead()

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\Tests\EventListener; namespace Symfony\Component\HttpKernel\Tests\EventListener;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\EventListener\LocaleListener; use Symfony\Component\HttpKernel\EventListener\LocaleListener;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\Tests\EventListener; namespace Symfony\Component\HttpKernel\Tests\EventListener;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\EventListener\RouterListener; use Symfony\Component\HttpKernel\EventListener\RouterListener;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -3,7 +3,6 @@
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command; namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\HttpKernel\Bundle;
/** /**
* This command has a required parameter on the constructor and will be ignored by the default Bundle implementation. * This command has a required parameter on the constructor and will be ignored by the default Bundle implementation.

View File

@ -656,7 +656,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase
{ {
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL); $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$parsedValue = $formatter->parse($value, NumberFormatter::TYPE_INT32); $parsedValue = $formatter->parse($value, NumberFormatter::TYPE_INT32);
$this->assertSame($expected, $parsedValue); $this->assertSame($expected, $parsedValue, $message);
} }
public function parseTypeInt32Provider() public function parseTypeInt32Provider()

View File

@ -81,6 +81,6 @@ abstract class PropertyAccessorArrayAccessTest extends \PHPUnit_Framework_TestCa
*/ */
public function testIsWritable($collection, $path) public function testIsWritable($collection, $path)
{ {
$this->assertTrue($this->propertyAccessor->isWritable($collection, $path, 'Updated')); $this->assertTrue($this->propertyAccessor->isWritable($collection, $path));
} }
} }

View File

@ -166,33 +166,25 @@ abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAcces
public function testIsWritableReturnsTrueIfAdderAndRemoverExists() public function testIsWritableReturnsTrueIfAdderAndRemoverExists()
{ {
$car = $this->getMock(__CLASS__.'_Car'); $car = $this->getMock(__CLASS__.'_Car');
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third')); $this->assertTrue($this->propertyAccessor->isWritable($car, 'axes'));
$this->assertTrue($this->propertyAccessor->isWritable($car, 'axes', $axes));
} }
public function testIsWritableReturnsFalseIfOnlyAdderExists() public function testIsWritableReturnsFalseIfOnlyAdderExists()
{ {
$car = $this->getMock(__CLASS__.'_CarOnlyAdder'); $car = $this->getMock(__CLASS__.'_CarOnlyAdder');
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third')); $this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
} }
public function testIsWritableReturnsFalseIfOnlyRemoverExists() public function testIsWritableReturnsFalseIfOnlyRemoverExists()
{ {
$car = $this->getMock(__CLASS__.'_CarOnlyRemover'); $car = $this->getMock(__CLASS__.'_CarOnlyRemover');
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third')); $this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
} }
public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists() public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()
{ {
$car = $this->getMock(__CLASS__.'_CarNoAdderAndRemover'); $car = $this->getMock(__CLASS__.'_CarNoAdderAndRemover');
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third')); $this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
} }
/** /**

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Security\Core\Tests; namespace Symfony\Component\Security\Core\Tests;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
/** /**

View File

@ -121,7 +121,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
$secondEngine = $this->getEngineMock('template.php', false); $secondEngine = $this->getEngineMock('template.php', false);
$delegatingEngine = new DelegatingEngine(array($firstEngine, $secondEngine)); $delegatingEngine = new DelegatingEngine(array($firstEngine, $secondEngine));
$delegatingEngine->getEngine('template.php', array('foo' => 'bar')); $delegatingEngine->getEngine('template.php');
} }
private function getEngineMock($template, $supports) private function getEngineMock($template, $supports)

View File

@ -37,7 +37,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
*/ */
public function testFailedLangcodes($nplural, $langCodes) public function testFailedLangcodes($nplural, $langCodes)
{ {
$matrix = $this->generateTestData($nplural, $langCodes); $matrix = $this->generateTestData($langCodes);
$this->validateMatrix($nplural, $matrix, false); $this->validateMatrix($nplural, $matrix, false);
} }
@ -46,7 +46,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
*/ */
public function testLangcodes($nplural, $langCodes) public function testLangcodes($nplural, $langCodes)
{ {
$matrix = $this->generateTestData($nplural, $langCodes); $matrix = $this->generateTestData($langCodes);
$this->validateMatrix($nplural, $matrix); $this->validateMatrix($nplural, $matrix);
} }
@ -108,7 +108,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
} }
} }
protected function generateTestData($plural, $langCodes) protected function generateTestData($langCodes)
{ {
$matrix = array(); $matrix = array();
foreach ($langCodes as $langCode) { foreach ($langCodes as $langCode) {