Minor fixes
This commit is contained in:
parent
bdfc2aa652
commit
774c984863
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Bridge\Twig\Tests\Extension;
|
||||
|
||||
use Symfony\Bridge\Twig\Extension\ExpressionExtension;
|
||||
use Symfony\Component\ExpressionLanguage\Expression;
|
||||
|
||||
class ExpressionExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -23,7 +23,6 @@ use Symfony\Component\Config\Resource\DirectoryResource;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\Validator\Validation;
|
||||
|
||||
/**
|
||||
* FrameworkExtension.
|
||||
|
@ -18,7 +18,6 @@ use Symfony\Component\DependencyInjection\DefinitionDecorator;
|
||||
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\Validator\Validation;
|
||||
|
||||
abstract class FrameworkExtensionTest extends TestCase
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ class SessionController extends ContainerAware
|
||||
|
||||
public function logoutAction(Request $request)
|
||||
{
|
||||
$request->getSession('session')->invalidate();
|
||||
$request->getSession()->invalidate();
|
||||
|
||||
return new Response('Session cleared.');
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ EOF
|
||||
|
||||
return 1;
|
||||
}
|
||||
$passwordQuestion = $this->createPasswordQuestion($input, $output);
|
||||
$passwordQuestion = $this->createPasswordQuestion();
|
||||
$password = $output->askQuestion($passwordQuestion);
|
||||
}
|
||||
|
||||
|
@ -248,11 +248,6 @@ class LegacyDialogHelperTest extends \PHPUnit_Framework_TestCase
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function hasStderrSupport()
|
||||
{
|
||||
return false === $this->isRunningOS400();
|
||||
}
|
||||
|
||||
private function hasSttyAvailable()
|
||||
{
|
||||
exec('stty 2>&1', $output, $exitcode);
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Component\Debug\Tests;
|
||||
|
||||
use Symfony\Component\Debug\DebugClassLoader;
|
||||
use Symfony\Component\Debug\ErrorHandler;
|
||||
use Symfony\Component\Debug\Exception\ContextErrorException;
|
||||
|
||||
class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Component\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
@ -51,7 +51,7 @@ class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame('b_alias', $aDefinition->getFactoryService(false));
|
||||
$this->assertTrue($container->has('container'));
|
||||
|
||||
$resolvedFactory = $aDefinition->getFactory(false);
|
||||
$resolvedFactory = $aDefinition->getFactory();
|
||||
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
try {
|
||||
@$builder->get('baz');
|
||||
$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');
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ require_once __DIR__.'/../includes/classes.php';
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\ExpressionLanguage\Expression;
|
||||
|
||||
$container = new ContainerBuilder();
|
||||
$container->
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Component\DependencyInjection\Tests\Loader;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Component\DomCrawler\Tests;
|
||||
|
||||
use Symfony\Component\DomCrawler\Form;
|
||||
use Symfony\Component\DomCrawler\FormFieldRegistry;
|
||||
use Symfony\Component\DomCrawler\Field;
|
||||
|
||||
class FormTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
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\AuthorType;
|
||||
|
||||
|
@ -58,7 +58,7 @@ class LegacyPdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$storage = new LegacyPdoSessionHandler($this->pdo, array('db_table' => 'bad_name'));
|
||||
$this->setExpectedException('RuntimeException');
|
||||
$storage->read('foo', 'bar');
|
||||
$storage->read('foo');
|
||||
}
|
||||
|
||||
public function testWriteRead()
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\EventListener;
|
||||
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\EventListener\LocaleListener;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\EventListener;
|
||||
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\EventListener\RouterListener;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\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.
|
||||
|
@ -656,7 +656,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
|
||||
$parsedValue = $formatter->parse($value, NumberFormatter::TYPE_INT32);
|
||||
$this->assertSame($expected, $parsedValue);
|
||||
$this->assertSame($expected, $parsedValue, $message);
|
||||
}
|
||||
|
||||
public function parseTypeInt32Provider()
|
||||
|
@ -81,6 +81,6 @@ abstract class PropertyAccessorArrayAccessTest extends \PHPUnit_Framework_TestCa
|
||||
*/
|
||||
public function testIsWritable($collection, $path)
|
||||
{
|
||||
$this->assertTrue($this->propertyAccessor->isWritable($collection, $path, 'Updated'));
|
||||
$this->assertTrue($this->propertyAccessor->isWritable($collection, $path));
|
||||
}
|
||||
}
|
||||
|
@ -166,33 +166,25 @@ abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAcces
|
||||
public function testIsWritableReturnsTrueIfAdderAndRemoverExists()
|
||||
{
|
||||
$car = $this->getMock(__CLASS__.'_Car');
|
||||
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third'));
|
||||
|
||||
$this->assertTrue($this->propertyAccessor->isWritable($car, 'axes', $axes));
|
||||
$this->assertTrue($this->propertyAccessor->isWritable($car, 'axes'));
|
||||
}
|
||||
|
||||
public function testIsWritableReturnsFalseIfOnlyAdderExists()
|
||||
{
|
||||
$car = $this->getMock(__CLASS__.'_CarOnlyAdder');
|
||||
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third'));
|
||||
|
||||
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
|
||||
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
|
||||
}
|
||||
|
||||
public function testIsWritableReturnsFalseIfOnlyRemoverExists()
|
||||
{
|
||||
$car = $this->getMock(__CLASS__.'_CarOnlyRemover');
|
||||
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third'));
|
||||
|
||||
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
|
||||
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
|
||||
}
|
||||
|
||||
public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()
|
||||
{
|
||||
$car = $this->getMock(__CLASS__.'_CarNoAdderAndRemover');
|
||||
$axes = $this->getContainer(array(1 => 'first', 2 => 'second', 3 => 'third'));
|
||||
|
||||
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
|
||||
$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,8 +11,6 @@
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -121,7 +121,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
|
||||
$secondEngine = $this->getEngineMock('template.php', false);
|
||||
|
||||
$delegatingEngine = new DelegatingEngine(array($firstEngine, $secondEngine));
|
||||
$delegatingEngine->getEngine('template.php', array('foo' => 'bar'));
|
||||
$delegatingEngine->getEngine('template.php');
|
||||
}
|
||||
|
||||
private function getEngineMock($template, $supports)
|
||||
|
@ -37,7 +37,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFailedLangcodes($nplural, $langCodes)
|
||||
{
|
||||
$matrix = $this->generateTestData($nplural, $langCodes);
|
||||
$matrix = $this->generateTestData($langCodes);
|
||||
$this->validateMatrix($nplural, $matrix, false);
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLangcodes($nplural, $langCodes)
|
||||
{
|
||||
$matrix = $this->generateTestData($nplural, $langCodes);
|
||||
$matrix = $this->generateTestData($langCodes);
|
||||
$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();
|
||||
foreach ($langCodes as $langCode) {
|
||||
|
Reference in New Issue
Block a user