Merge branch '2.3' into 2.4
* 2.3: fixed CS [Process] fixed some volatile tests [HttpKernel] fixed a volatile test [HttpFoundation] fixed some volatile tests Use getPathname() instead of string casting to get BinaryFileReponse file path Conflicts: src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php src/Symfony/Component/Config/Definition/ReferenceDumper.php src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php src/Symfony/Component/Console/Application.php src/Symfony/Component/Console/Tests/ApplicationTest.php src/Symfony/Component/Filesystem/Exception/IOException.php src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php src/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php src/Symfony/Component/PropertyAccess/PropertyAccessor.php src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php src/Symfony/Component/Serializer/Encoder/XmlEncoder.php src/Symfony/Component/Validator/Constraints/CollectionValidator.php src/Symfony/Component/Validator/Tests/ExecutionContextTest.php
This commit is contained in:
commit
27e8c654db
@ -207,11 +207,11 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
} elseif ($driverType == 'annotation') {
|
||||
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
|
||||
new Reference($this->getObjectManagerElementName('metadata.annotation_reader')),
|
||||
array_values($driverPaths)
|
||||
array_values($driverPaths),
|
||||
));
|
||||
} else {
|
||||
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
|
||||
array_values($driverPaths)
|
||||
array_values($driverPaths),
|
||||
));
|
||||
}
|
||||
$mappingDriverDef->setPublic(false);
|
||||
@ -320,7 +320,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
$cacheDef = new Definition($memcacheClass);
|
||||
$memcacheInstance = new Definition($memcacheInstanceClass);
|
||||
$memcacheInstance->addMethodCall('connect', array(
|
||||
$memcacheHost, $memcachePort
|
||||
$memcacheHost, $memcachePort,
|
||||
));
|
||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name'])), $memcacheInstance);
|
||||
$cacheDef->addMethodCall('setMemcache', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name'])))));
|
||||
@ -333,7 +333,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
$cacheDef = new Definition($memcachedClass);
|
||||
$memcachedInstance = new Definition($memcachedInstanceClass);
|
||||
$memcachedInstance->addMethodCall('addServer', array(
|
||||
$memcachedHost, $memcachedPort
|
||||
$memcachedHost, $memcachedPort,
|
||||
));
|
||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])), $memcachedInstance);
|
||||
$cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])))));
|
||||
@ -346,7 +346,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
$cacheDef = new Definition($redisClass);
|
||||
$redisInstance = new Definition($redisInstanceClass);
|
||||
$redisInstance->addMethodCall('connect', array(
|
||||
$redisHost, $redisPort
|
||||
$redisHost, $redisPort,
|
||||
));
|
||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])), $redisInstance);
|
||||
$cacheDef->addMethodCall('setRedis', array(new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])))));
|
||||
|
@ -456,7 +456,7 @@ class EntityChoiceList extends ObjectChoiceList
|
||||
{
|
||||
if (!$this->em->contains($entity)) {
|
||||
throw new RuntimeException(
|
||||
'Entities passed to the choice field must be managed. Maybe ' .
|
||||
'Entities passed to the choice field must be managed. Maybe '.
|
||||
'persist them in the entity manager?'
|
||||
);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ abstract class DoctrineType extends AbstractType
|
||||
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$choiceListCache =& $this->choiceListCache;
|
||||
$choiceListCache = & $this->choiceListCache;
|
||||
$registry = $this->registry;
|
||||
$propertyAccessor = $this->propertyAccessor;
|
||||
$type = $this;
|
||||
@ -121,7 +121,7 @@ abstract class DoctrineType extends AbstractType
|
||||
$loaderHash,
|
||||
$choiceHashes,
|
||||
$preferredChoiceHashes,
|
||||
$groupByHash
|
||||
$groupByHash,
|
||||
)));
|
||||
|
||||
if (!isset($choiceListCache[$hash])) {
|
||||
@ -150,7 +150,7 @@ abstract class DoctrineType extends AbstractType
|
||||
|
||||
if (null === $em) {
|
||||
throw new RuntimeException(sprintf(
|
||||
'Class "%s" seems not to be a managed Doctrine entity. ' .
|
||||
'Class "%s" seems not to be a managed Doctrine entity. '.
|
||||
'Did you forget to map it?',
|
||||
$options['class']
|
||||
));
|
||||
|
@ -218,18 +218,18 @@ class DbalSessionHandler implements \SessionHandlerInterface
|
||||
|
||||
switch ($platform) {
|
||||
case 'mysql':
|
||||
return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " .
|
||||
return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
|
||||
"ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->timeCol = VALUES($this->timeCol)";
|
||||
case 'oracle':
|
||||
// DUAL is Oracle specific dummy table
|
||||
return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) " .
|
||||
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " .
|
||||
return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) ".
|
||||
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
|
||||
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time";
|
||||
case $this->con->getDatabasePlatform() instanceof SQLServer2008Platform:
|
||||
// MERGE is only available since SQL Server 2008 and must be terminated by semicolon
|
||||
// It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx
|
||||
return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) " .
|
||||
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " .
|
||||
return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) ".
|
||||
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
|
||||
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;";
|
||||
case 'sqlite':
|
||||
return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)";
|
||||
|
@ -61,7 +61,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
public function loadTokenBySeries($series)
|
||||
{
|
||||
$sql = 'SELECT class, username, value, lastUsed'
|
||||
. ' FROM rememberme_token WHERE series=:series';
|
||||
.' FROM rememberme_token WHERE series=:series';
|
||||
$paramValues = array('series' => $series);
|
||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
|
||||
@ -95,13 +95,13 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
public function updateToken($series, $tokenValue, \DateTime $lastUsed)
|
||||
{
|
||||
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
|
||||
. ' WHERE series=:series';
|
||||
.' WHERE series=:series';
|
||||
$paramValues = array('value' => $tokenValue,
|
||||
'lastUsed' => $lastUsed,
|
||||
'series' => $series);
|
||||
'series' => $series,);
|
||||
$paramTypes = array('value' => \PDO::PARAM_STR,
|
||||
'lastUsed' => DoctrineType::DATETIME,
|
||||
'series' => \PDO::PARAM_STR);
|
||||
'series' => \PDO::PARAM_STR,);
|
||||
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||
if ($updated < 1) {
|
||||
throw new TokenNotFoundException('No token found.');
|
||||
@ -114,18 +114,18 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
public function createNewToken(PersistentTokenInterface $token)
|
||||
{
|
||||
$sql = 'INSERT INTO rememberme_token'
|
||||
. ' (class, username, series, value, lastUsed)'
|
||||
. ' VALUES (:class, :username, :series, :value, :lastUsed)';
|
||||
.' (class, username, series, value, lastUsed)'
|
||||
.' VALUES (:class, :username, :series, :value, :lastUsed)';
|
||||
$paramValues = array('class' => $token->getClass(),
|
||||
'username' => $token->getUsername(),
|
||||
'series' => $token->getSeries(),
|
||||
'value' => $token->getTokenValue(),
|
||||
'lastUsed' => $token->getLastUsed());
|
||||
'lastUsed' => $token->getLastUsed(),);
|
||||
$paramTypes = array('class' => \PDO::PARAM_STR,
|
||||
'username' => \PDO::PARAM_STR,
|
||||
'series' => \PDO::PARAM_STR,
|
||||
'value' => \PDO::PARAM_STR,
|
||||
'lastUsed' => DoctrineType::DATETIME);
|
||||
'lastUsed' => DoctrineType::DATETIME,);
|
||||
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class EntityUserProvider implements UserProviderInterface
|
||||
if (!$id = $this->metadata->getIdentifierValues($user)) {
|
||||
throw new \InvalidArgumentException("You cannot refresh a user ".
|
||||
"from the EntityUserProvider that does not contain an identifier. ".
|
||||
"The user object has to be serialized with its own identifier " .
|
||||
"The user object has to be serialized with its own identifier ".
|
||||
"mapped by Doctrine."
|
||||
);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(0, $c->getQueryCount());
|
||||
|
||||
$queries = array(
|
||||
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 0)
|
||||
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 0),
|
||||
);
|
||||
$c = $this->createCollector($queries);
|
||||
$c->collect(new Request(), new Response());
|
||||
@ -53,7 +53,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(0, $c->getTime());
|
||||
|
||||
$queries = array(
|
||||
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1)
|
||||
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1),
|
||||
);
|
||||
$c = $this->createCollector($queries);
|
||||
$c->collect(new Request(), new Response());
|
||||
@ -61,7 +61,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$queries = array(
|
||||
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1),
|
||||
array('sql' => "SELECT * FROM table2", 'params' => array(), 'types' => array(), 'executionMS' => 2)
|
||||
array('sql' => "SELECT * FROM table2", 'params' => array(), 'types' => array(), 'executionMS' => 2),
|
||||
);
|
||||
$c = $this->createCollector($queries);
|
||||
$c->collect(new Request(), new Response());
|
||||
@ -74,7 +74,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
||||
public function testCollectQueries($param, $types, $expected, $explainable)
|
||||
{
|
||||
$queries = array(
|
||||
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1)
|
||||
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1),
|
||||
);
|
||||
$c = $this->createCollector($queries);
|
||||
$c->collect(new Request(), new Response());
|
||||
@ -90,7 +90,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
||||
public function testSerialization($param, $types, $expected, $explainable)
|
||||
{
|
||||
$queries = array(
|
||||
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1)
|
||||
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1),
|
||||
);
|
||||
$c = $this->createCollector($queries);
|
||||
$c->collect(new Request(), new Response());
|
||||
|
@ -201,7 +201,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame(array(1 => $entity1, 2 => $entity2), $choiceList->getChoices());
|
||||
$this->assertEquals(array(
|
||||
'group1' => array(1 => new ChoiceView($entity1, '1', 'Foo')),
|
||||
'group2' => array(2 => new ChoiceView($entity2, '2', 'Bar'))
|
||||
'group2' => array(2 => new ChoiceView($entity2, '2', 'Bar')),
|
||||
), $choiceList->getRemainingViews());
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array(
|
||||
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
||||
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
||||
4 => new ChoiceView($item4, '4', 'Boo!')
|
||||
4 => new ChoiceView($item4, '4', 'Boo!'),
|
||||
), $choiceList->getRemainingViews());
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals(array(
|
||||
1 => $item1,
|
||||
2 => $item2
|
||||
2 => $item2,
|
||||
), $choiceList->getChoices());
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase
|
||||
$classMetadata->expects($this->once())->method('hasField')->with('field')->will($this->returnValue(false));
|
||||
$classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true));
|
||||
|
||||
$mapping = array('joinColumns' => array(array('nullable'=>true)));
|
||||
$mapping = array('joinColumns' => array(array('nullable' => true)));
|
||||
$classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping));
|
||||
|
||||
$return[] = array($classMetadata, new ValueGuess(false, Guess::HIGH_CONFIDENCE));
|
||||
@ -69,7 +69,7 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase
|
||||
$classMetadata->expects($this->once())->method('hasField')->with('field')->will($this->returnValue(false));
|
||||
$classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true));
|
||||
|
||||
$mapping = array('joinColumns' => array(array('nullable'=>false)));
|
||||
$mapping = array('joinColumns' => array(array('nullable' => false)));
|
||||
$classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping));
|
||||
|
||||
$return[] = array($classMetadata, new ValueGuess(true, Guess::HIGH_CONFIDENCE));
|
||||
@ -94,5 +94,4 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
return new DoctrineOrmTypeGuesser($registry);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
|
||||
|
||||
return array(
|
||||
new CoreExtension(),
|
||||
new DoctrineOrmExtension($manager)
|
||||
new DoctrineOrmExtension($manager),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ class EntityTypeTest extends TypeTestCase
|
||||
'em' => 'default',
|
||||
'class' => self::SINGLE_IDENT_CLASS,
|
||||
'required' => false,
|
||||
'property' => 'name'
|
||||
'property' => 'name',
|
||||
));
|
||||
|
||||
$this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']);
|
||||
@ -165,7 +165,7 @@ class EntityTypeTest extends TypeTestCase
|
||||
'class' => self::SINGLE_IDENT_CLASS,
|
||||
'required' => false,
|
||||
'property' => 'name',
|
||||
'query_builder' => $qb
|
||||
'query_builder' => $qb,
|
||||
));
|
||||
|
||||
$this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']);
|
||||
@ -541,7 +541,7 @@ class EntityTypeTest extends TypeTestCase
|
||||
$this->assertEquals(array(
|
||||
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
||||
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
||||
'4' => new ChoiceView($item4, '4', 'Boo!')
|
||||
'4' => new ChoiceView($item4, '4', 'Boo!'),
|
||||
), $field->createView()->vars['choices']);
|
||||
}
|
||||
|
||||
@ -754,7 +754,7 @@ class EntityTypeTest extends TypeTestCase
|
||||
$this->factory->createNamed('name', 'entity', null, array(
|
||||
'class' => self::SINGLE_IDENT_CLASS,
|
||||
'required' => false,
|
||||
'property' => 'name'
|
||||
'property' => 'name',
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -138,5 +138,4 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
|
||||
'long' => $longString,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ class UniqueEntityValidator extends ConstraintValidator
|
||||
$em = $this->registry->getManager($constraint->em);
|
||||
|
||||
if (!$em) {
|
||||
throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em));
|
||||
throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em));
|
||||
}
|
||||
} else {
|
||||
$em = $this->registry->getManagerForClass(get_class($entity));
|
||||
@ -101,7 +101,7 @@ class UniqueEntityValidator extends ConstraintValidator
|
||||
|
||||
if (count($relatedId) > 1) {
|
||||
throw new ConstraintDefinitionException(
|
||||
"Associated entities are not allowed to have more than one identifier field to be " .
|
||||
"Associated entities are not allowed to have more than one identifier field to be ".
|
||||
"part of a unique constraint in: ".$class->getName()."#".$fieldName
|
||||
);
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ class ChromePhpHandler extends BaseChromePhpHandler
|
||||
}
|
||||
|
||||
if (!preg_match('{\bChrome/\d+[\.\d+]*\b}', $event->getRequest()->headers->get('User-Agent'))) {
|
||||
|
||||
$this->sendHeaders = false;
|
||||
$this->headers = array();
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
|
||||
OutputInterface::VERBOSITY_NORMAL => Logger::WARNING,
|
||||
OutputInterface::VERBOSITY_VERBOSE => Logger::NOTICE,
|
||||
OutputInterface::VERBOSITY_VERY_VERBOSE => Logger::INFO,
|
||||
OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG
|
||||
OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG,
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,6 @@ class FirePHPHandler extends BaseFirePHPHandler
|
||||
|
||||
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))
|
||||
&& !$event->getRequest()->headers->has('X-FirePHP-Version')) {
|
||||
|
||||
$this->sendHeaders = false;
|
||||
$this->headers = array();
|
||||
|
||||
|
@ -70,10 +70,10 @@ class ConsoleHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
array(OutputInterface::VERBOSITY_DEBUG, Logger::DEBUG, true),
|
||||
array(OutputInterface::VERBOSITY_DEBUG, Logger::EMERGENCY, true),
|
||||
array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, true, array(
|
||||
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE
|
||||
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE,
|
||||
)),
|
||||
array(OutputInterface::VERBOSITY_DEBUG, Logger::NOTICE, true, array(
|
||||
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE
|
||||
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE,
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class WebProcessorTest extends \PHPUnit_Framework_TestCase
|
||||
'REMOTE_ADDR' => 'B',
|
||||
'REQUEST_METHOD' => 'C',
|
||||
'SERVER_NAME' => 'D',
|
||||
'HTTP_REFERER' => 'E'
|
||||
'HTTP_REFERER' => 'E',
|
||||
);
|
||||
|
||||
$request = new Request();
|
||||
|
@ -22,7 +22,6 @@ use Symfony\Component\Form\FormEvent;
|
||||
*/
|
||||
class TranslationCollectionFormListener implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
private $i18nClass;
|
||||
private $languages;
|
||||
|
||||
|
@ -70,7 +70,7 @@ class TranslationFormListener implements EventSubscriberInterface
|
||||
$customOptions = $options['options'];
|
||||
}
|
||||
$options = array(
|
||||
'label' => $label.' '.strtoupper($data->getLocale())
|
||||
'label' => $label.' '.strtoupper($data->getLocale()),
|
||||
);
|
||||
|
||||
$options = array_merge($options, $customOptions);
|
||||
|
@ -26,7 +26,7 @@ class PropelExtension extends AbstractExtension
|
||||
return array(
|
||||
new Type\ModelType(PropertyAccess::createPropertyAccessor()),
|
||||
new Type\TranslationCollectionType(),
|
||||
new Type\TranslationType()
|
||||
new Type\TranslationType(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class TranslationCollectionType extends AbstractType
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setRequired(array(
|
||||
'languages'
|
||||
'languages',
|
||||
));
|
||||
|
||||
$resolver->setDefaults(array(
|
||||
@ -68,8 +68,8 @@ class TranslationCollectionType extends AbstractType
|
||||
'allow_delete' => false,
|
||||
'options' => array(
|
||||
'data_class' => null,
|
||||
'columns' => null
|
||||
)
|
||||
'columns' => null,
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class TranslationType extends AbstractType
|
||||
{
|
||||
$resolver->setRequired(array(
|
||||
'data_class',
|
||||
'columns'
|
||||
'columns',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -40,9 +40,9 @@ class PropelDataCollectorTest extends Propel1TestCase
|
||||
array(
|
||||
'sql' => "SET NAMES 'utf8'",
|
||||
'time' => '0.000 sec',
|
||||
'connection'=> 'default',
|
||||
'memory' => '1.4 MB'
|
||||
)
|
||||
'connection' => 'default',
|
||||
'memory' => '1.4 MB',
|
||||
),
|
||||
), $c->getQueries());
|
||||
$this->assertEquals(1, $c->getQueryCount());
|
||||
}
|
||||
@ -62,20 +62,20 @@ class PropelDataCollectorTest extends Propel1TestCase
|
||||
array(
|
||||
'sql' => "SET NAMES 'utf8'",
|
||||
'time' => '0.000 sec',
|
||||
'connection'=> 'default',
|
||||
'memory' => '1.4 MB'
|
||||
'connection' => 'default',
|
||||
'memory' => '1.4 MB',
|
||||
),
|
||||
array(
|
||||
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
|
||||
'time' => '0.012 sec',
|
||||
'connection'=> 'default',
|
||||
'memory' => '2.4 MB'
|
||||
'connection' => 'default',
|
||||
'memory' => '2.4 MB',
|
||||
),
|
||||
array(
|
||||
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
|
||||
'time' => '0.012 sec',
|
||||
'connection'=> 'default',
|
||||
'memory' => '2.4 MB'
|
||||
'connection' => 'default',
|
||||
'memory' => '2.4 MB',
|
||||
),
|
||||
), $c->getQueries());
|
||||
$this->assertEquals(3, $c->getQueryCount());
|
||||
|
@ -123,7 +123,7 @@ class ItemQuery
|
||||
return array(
|
||||
$mainAuthorRelation,
|
||||
$authorRelation,
|
||||
$resellerRelation
|
||||
$resellerRelation,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,6 @@ class TranslatableItemI18n implements \Persistent
|
||||
|
||||
public function setLocale($locale)
|
||||
{
|
||||
|
||||
$this->locale = $locale;
|
||||
}
|
||||
|
||||
@ -115,7 +114,6 @@ class TranslatableItemI18n implements \Persistent
|
||||
|
||||
public function setValue($value)
|
||||
{
|
||||
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
@ -126,7 +124,6 @@ class TranslatableItemI18n implements \Persistent
|
||||
|
||||
public function setValue2($value2)
|
||||
{
|
||||
|
||||
$this->value2 = $value2;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
||||
null,
|
||||
null,
|
||||
array(
|
||||
$item1
|
||||
$item1,
|
||||
)
|
||||
);
|
||||
|
||||
@ -122,7 +122,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
||||
$this->assertSame(array(1 => $item1, 2 => $item2), $choiceList->getChoices());
|
||||
$this->assertEquals(array(
|
||||
'group1' => array(1 => new ChoiceView($item1, '1', 'Foo')),
|
||||
'group2' => array(2 => new ChoiceView($item2, '2', 'Bar'))
|
||||
'group2' => array(2 => new ChoiceView($item2, '2', 'Bar')),
|
||||
), $choiceList->getRemainingViews());
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
||||
$this->assertEquals(array(
|
||||
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
||||
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
||||
4 => new ChoiceView($item4, '4', 'Boo!')
|
||||
4 => new ChoiceView($item4, '4', 'Boo!'),
|
||||
), $choiceList->getRemainingViews());
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
||||
|
||||
$this->assertEquals(array(
|
||||
1 => $item1,
|
||||
2 => $item2
|
||||
2 => $item2,
|
||||
), $choiceList->getChoices());
|
||||
}
|
||||
|
||||
|
@ -102,4 +102,6 @@ class CollectionToArrayTransformerTest extends Propel1TestCase
|
||||
}
|
||||
}
|
||||
|
||||
class DummyObject {}
|
||||
class DummyObject
|
||||
{
|
||||
}
|
||||
|
@ -42,15 +42,15 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
||||
$item->addTranslatableItemI18n(new TranslatableItemI18n(2, 'en', 'val2'));
|
||||
|
||||
$builder = $this->factory->createBuilder('form', null, array(
|
||||
'data_class' => self::TRANSLATION_CLASS
|
||||
'data_class' => self::TRANSLATION_CLASS,
|
||||
));
|
||||
|
||||
$builder->add('translatableItemI18ns', 'propel1_translation_collection', array(
|
||||
'languages' => array('en', 'fr'),
|
||||
'options' => array(
|
||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
||||
'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea'))
|
||||
)
|
||||
'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')),
|
||||
),
|
||||
));
|
||||
$form = $builder->getForm();
|
||||
$form->setData($item);
|
||||
@ -79,14 +79,14 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
||||
$this->assertCount(0, $item->getTranslatableItemI18ns());
|
||||
|
||||
$builder = $this->factory->createBuilder('form', null, array(
|
||||
'data_class' => self::TRANSLATION_CLASS
|
||||
'data_class' => self::TRANSLATION_CLASS,
|
||||
));
|
||||
$builder->add('translatableItemI18ns', 'propel1_translation_collection', array(
|
||||
'languages' => array('en', 'fr'),
|
||||
'options' => array(
|
||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
||||
'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea'))
|
||||
)
|
||||
'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')),
|
||||
),
|
||||
));
|
||||
|
||||
$form = $builder->getForm();
|
||||
@ -103,14 +103,14 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
||||
$item = new Item(null, 'val');
|
||||
|
||||
$builder = $this->factory->createBuilder('form', null, array(
|
||||
'data_class' => self::NON_TRANSLATION_CLASS
|
||||
'data_class' => self::NON_TRANSLATION_CLASS,
|
||||
));
|
||||
$builder->add('value', 'propel1_translation_collection', array(
|
||||
'languages' => array('en', 'fr'),
|
||||
'options' => array(
|
||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
||||
'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea'))
|
||||
)
|
||||
'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')),
|
||||
),
|
||||
));
|
||||
|
||||
$form = $builder->getForm();
|
||||
@ -125,8 +125,8 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
||||
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
||||
'languages' => array('en', 'fr'),
|
||||
'options' => array(
|
||||
'columns' => array('value', 'value2')
|
||||
)
|
||||
'columns' => array('value', 'value2'),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@ -138,8 +138,8 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
||||
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
||||
'options' => array(
|
||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
||||
'columns' => array('value', 'value2')
|
||||
)
|
||||
'columns' => array('value', 'value2'),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@ -151,8 +151,8 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
||||
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
||||
'languages' => array('en', 'fr'),
|
||||
'options' => array(
|
||||
'data_class' => self::TRANSLATABLE_I18N_CLASS
|
||||
)
|
||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy;
|
||||
|
||||
require_once __DIR__ . '/Fixtures/includes/foo.php';
|
||||
require_once __DIR__.'/Fixtures/includes/foo.php';
|
||||
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
@ -65,7 +65,6 @@ class LazyServiceProjectServiceContainer extends Container
|
||||
|
||||
class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \ProxyManager\Proxy\LazyLoadingInterface, \ProxyManager\Proxy\ValueHolderInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \Closure|null initializer responsible for generating the wrapped object
|
||||
*/
|
||||
@ -195,5 +194,4 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr
|
||||
{
|
||||
return $this->valueHolder5157dd96e88c0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class ProxyDumperTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertStringMatchesFormat(
|
||||
'%Aclass SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest%aextends%w'
|
||||
. '\Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper\ProxyDumperTest%a',
|
||||
.'\Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper\ProxyDumperTest%a',
|
||||
$code
|
||||
);
|
||||
}
|
||||
@ -72,10 +72,10 @@ class ProxyDumperTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertStringMatchesFormat(
|
||||
'%wif ($lazyLoad) {%w$container = $this;%wreturn $this->services[\'foo\'] = new '
|
||||
. 'SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest_%s(%wfunction '
|
||||
. '(&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {'
|
||||
. '%w$wrappedInstance = $container->getFooService(false);%w$proxy->setProxyInitializer(null);'
|
||||
. '%wreturn true;%w}%w);%w}%w',
|
||||
.'SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest_%s(%wfunction '
|
||||
.'(&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {'
|
||||
.'%w$wrappedInstance = $container->getFooService(false);%w$proxy->setProxyInitializer(null);'
|
||||
.'%wreturn true;%w}%w);%w}%w',
|
||||
$code
|
||||
);
|
||||
}
|
||||
@ -88,7 +88,7 @@ class ProxyDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$definitions = array(
|
||||
array(new Definition(__CLASS__), true),
|
||||
array(new Definition('stdClass'), true),
|
||||
array(new Definition('foo' . uniqid()), false),
|
||||
array(new Definition('foo'.uniqid()), false),
|
||||
array(new Definition(), false),
|
||||
);
|
||||
|
||||
|
@ -35,6 +35,5 @@ class FormThemeNode extends \Twig_Node
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('resources'))
|
||||
->raw(");\n");
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class RenderBlockNode extends \Twig_Node_Expression_Function
|
||||
|
||||
if (isset($arguments[0])) {
|
||||
$compiler->subcompile($arguments[0]);
|
||||
$compiler->raw(', \'' . $this->getAttribute('name') . '\'');
|
||||
$compiler->raw(', \''.$this->getAttribute('name').'\'');
|
||||
|
||||
if (isset($arguments[1])) {
|
||||
$compiler->raw(', ');
|
||||
|
@ -53,7 +53,7 @@ class CodeExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
array('F\Q\N\Foo::Method', '<abbr title="F\Q\N\Foo">Foo</abbr>::Method()'),
|
||||
array('Bare::Method', '<abbr title="Bare">Bare</abbr>::Method()'),
|
||||
array('Closure', '<abbr title="Closure">Closure</abbr>'),
|
||||
array('Method', '<abbr title="Method">Method</abbr>()')
|
||||
array('Method', '<abbr title="Method">Method</abbr>()'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -194,14 +194,14 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
|
||||
public static function themeBlockInheritanceProvider()
|
||||
{
|
||||
return array(
|
||||
array(array('theme.html.twig'))
|
||||
array(array('theme.html.twig')),
|
||||
);
|
||||
}
|
||||
|
||||
public static function themeInheritanceProvider()
|
||||
{
|
||||
return array(
|
||||
array(array('parent_label.html.twig'), array('child_label.html.twig'))
|
||||
array(array('parent_label.html.twig'), array('child_label.html.twig')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -87,17 +87,17 @@ class TranslationExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
// transchoice
|
||||
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
'There is no apples', array('count' => 0)),
|
||||
'There is no apples', array('count' => 0),),
|
||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
'There is 5 apples', array('count' => 5)),
|
||||
'There is 5 apples', array('count' => 5),),
|
||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||
'There is 5 apples (Symfony2)', array('count' => 5, 'name' => 'Symfony2')),
|
||||
'There is 5 apples (Symfony2)', array('count' => 5, 'name' => 'Symfony2'),),
|
||||
array('{% transchoice count with { \'%name%\': \'Symfony2\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
||||
'There is 5 apples (Symfony2)', array('count' => 5)),
|
||||
'There is 5 apples (Symfony2)', array('count' => 5),),
|
||||
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
'There is no apples', array('count' => 0)),
|
||||
'There is no apples', array('count' => 0),),
|
||||
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||
'There is 5 apples'),
|
||||
'There is 5 apples',),
|
||||
|
||||
// trans filter
|
||||
array('{{ "Hello"|trans }}', 'Hello'),
|
||||
|
@ -20,7 +20,7 @@ class FormThemeTest extends \PHPUnit_Framework_TestCase
|
||||
$form = new \Twig_Node_Expression_Name('form', 0);
|
||||
$resources = new \Twig_Node(array(
|
||||
new \Twig_Node_Expression_Constant('tpl1', 0),
|
||||
new \Twig_Node_Expression_Constant('tpl2', 0)
|
||||
new \Twig_Node_Expression_Constant('tpl2', 0),
|
||||
));
|
||||
|
||||
$node = new FormThemeNode($form, $resources, 0);
|
||||
@ -36,7 +36,7 @@ class FormThemeTest extends \PHPUnit_Framework_TestCase
|
||||
new \Twig_Node_Expression_Constant(0, 0),
|
||||
new \Twig_Node_Expression_Constant('tpl1', 0),
|
||||
new \Twig_Node_Expression_Constant(1, 0),
|
||||
new \Twig_Node_Expression_Constant('tpl2', 0)
|
||||
new \Twig_Node_Expression_Constant('tpl2', 0),
|
||||
), 0);
|
||||
|
||||
$node = new FormThemeNode($form, $resources, 0);
|
||||
|
@ -42,7 +42,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
|
||||
), 1),
|
||||
1,
|
||||
'form_theme'
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'{% form_theme form "tpl1" "tpl2" %}',
|
||||
@ -52,11 +52,11 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
|
||||
new \Twig_Node_Expression_Constant(0, 1),
|
||||
new \Twig_Node_Expression_Constant('tpl1', 1),
|
||||
new \Twig_Node_Expression_Constant(1, 1),
|
||||
new \Twig_Node_Expression_Constant('tpl2', 1)
|
||||
new \Twig_Node_Expression_Constant('tpl2', 1),
|
||||
), 1),
|
||||
1,
|
||||
'form_theme'
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'{% form_theme form with "tpl1" %}',
|
||||
@ -65,7 +65,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
|
||||
new \Twig_Node_Expression_Constant('tpl1', 1),
|
||||
1,
|
||||
'form_theme'
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'{% form_theme form with ["tpl1"] %}',
|
||||
@ -77,7 +77,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
|
||||
), 1),
|
||||
1,
|
||||
'form_theme'
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'{% form_theme form with ["tpl1", "tpl2"] %}',
|
||||
@ -87,11 +87,11 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
|
||||
new \Twig_Node_Expression_Constant(0, 1),
|
||||
new \Twig_Node_Expression_Constant('tpl1', 1),
|
||||
new \Twig_Node_Expression_Constant(1, 1),
|
||||
new \Twig_Node_Expression_Constant('tpl2', 1)
|
||||
new \Twig_Node_Expression_Constant('tpl2', 1),
|
||||
), 1),
|
||||
1,
|
||||
'form_theme'
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class TranslationUpdateCommand extends ContainerAwareCommand
|
||||
new InputOption(
|
||||
'clean', null, InputOption::VALUE_NONE,
|
||||
'Should clean not found messages'
|
||||
)
|
||||
),
|
||||
))
|
||||
->setDescription('Updates the translation file')
|
||||
->setHelp(<<<EOF
|
||||
|
@ -90,7 +90,7 @@ class Router extends BaseRouter implements WarmableInterface
|
||||
}
|
||||
|
||||
foreach ($route->getRequirements() as $name => $value) {
|
||||
$route->setRequirement($name, $this->resolve($value));
|
||||
$route->setRequirement($name, $this->resolve($value));
|
||||
}
|
||||
|
||||
$route->setPath($this->resolve($route->getPath()));
|
||||
@ -138,7 +138,7 @@ class Router extends BaseRouter implements WarmableInterface
|
||||
}
|
||||
|
||||
throw new RuntimeException(sprintf(
|
||||
'The container parameter "%s", used in the route configuration value "%s", ' .
|
||||
'The container parameter "%s", used in the route configuration value "%s", '.
|
||||
'must be a string or numeric, but it is of type %s.',
|
||||
$match[1],
|
||||
$value,
|
||||
|
@ -53,5 +53,4 @@ class TemplateFinderTest extends TestCase
|
||||
$this->assertContains('::this.is.a.template.format.engine', $templates);
|
||||
$this->assertContains('::resource.format.engine', $templates);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
|
||||
'services' => array('show_private' => true),
|
||||
'public' => array('show_private' => false),
|
||||
'tag1' => array('show_private' => true, 'tag' => 'tag1'),
|
||||
'tags' => array('group_by' => 'tags', 'show_private' => true)
|
||||
'tags' => array('group_by' => 'tags', 'show_private' => true),
|
||||
);
|
||||
|
||||
$data = array();
|
||||
|
@ -60,7 +60,7 @@ class RedirectControllerTest extends TestCase
|
||||
'route' => $route,
|
||||
'permanent' => $permanent,
|
||||
'additional-parameter' => 'value',
|
||||
'ignoreAttributes' => $ignoreAttributes
|
||||
'ignoreAttributes' => $ignoreAttributes,
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -23,7 +23,7 @@ class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase
|
||||
$services = array(
|
||||
'my_cache_warmer_service1' => array(0 => array('priority' => 100)),
|
||||
'my_cache_warmer_service2' => array(0 => array('priority' => 200)),
|
||||
'my_cache_warmer_service3' => array()
|
||||
'my_cache_warmer_service3' => array(),
|
||||
);
|
||||
|
||||
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
|
||||
@ -46,7 +46,7 @@ class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase
|
||||
->with(0, array(
|
||||
new Reference('my_cache_warmer_service2'),
|
||||
new Reference('my_cache_warmer_service1'),
|
||||
new Reference('my_cache_warmer_service3')
|
||||
new Reference('my_cache_warmer_service3'),
|
||||
));
|
||||
|
||||
$addCacheWarmerPass = new AddCacheWarmerPass();
|
||||
|
@ -91,5 +91,4 @@ class AddConsoleCommandPassTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
class MyCommand extends Command
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass;
|
||||
*/
|
||||
class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testThrowExceptionWhenNoNormalizers()
|
||||
{
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
||||
@ -72,16 +71,16 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testServicesAreOrderedAccordingToPriority()
|
||||
{
|
||||
$services = array(
|
||||
$services = array(
|
||||
'n3' => array('tag' => array()),
|
||||
'n1' => array('tag' => array('priority' => 200)),
|
||||
'n2' => array('tag' => array('priority' => 100))
|
||||
'n2' => array('tag' => array('priority' => 100)),
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
$expected = array(
|
||||
new Reference('n1'),
|
||||
new Reference('n2'),
|
||||
new Reference('n3')
|
||||
new Reference('n3'),
|
||||
);
|
||||
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
||||
|
@ -40,8 +40,6 @@ class TranslatorPassTest extends \PHPUnit_Framework_TestCase
|
||||
$container->expects($this->once())
|
||||
->method('findDefinition')
|
||||
->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition')));
|
||||
;
|
||||
|
||||
$pass = new TranslatorPass();
|
||||
$pass->process($container);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
$configuration = new Configuration();
|
||||
$config = $processor->processConfiguration($configuration, array(array(
|
||||
'secret' => 's3cr3t',
|
||||
'trusted_proxies' => $trustedProxies
|
||||
'trusted_proxies' => $trustedProxies,
|
||||
)));
|
||||
|
||||
$this->assertEquals($processedProxies, $config['trusted_proxies']);
|
||||
@ -66,8 +66,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
$processor->processConfiguration($configuration, array(
|
||||
array(
|
||||
'secret' => 's3cr3t',
|
||||
'trusted_proxies' => 'Not an IP address'
|
||||
)
|
||||
'trusted_proxies' => 'Not an IP address',
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@ -81,8 +81,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
$processor->processConfiguration($configuration, array(
|
||||
array(
|
||||
'secret' => 's3cr3t',
|
||||
'trusted_proxies' => array('Not an IP address')
|
||||
)
|
||||
'trusted_proxies' => array('Not an IP address'),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@ -134,8 +134,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
'debug' => '%kernel.debug%',
|
||||
),
|
||||
'serializer' => array(
|
||||
'enabled' => false
|
||||
)
|
||||
'enabled' => false,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -13,5 +13,4 @@ namespace Symfony\Bundle\FrameworkBundle\Tests;
|
||||
|
||||
class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
$container->loadFromExtension('framework', array(
|
||||
'csrf_protection' => array(
|
||||
'enabled' => true,
|
||||
'field_name' => '_custom'
|
||||
'field_name' => '_custom',
|
||||
),
|
||||
'form' => array(
|
||||
'enabled' => true,
|
||||
|
@ -3,12 +3,12 @@
|
||||
$container->loadFromExtension('framework', array(
|
||||
'csrf_protection' => array(
|
||||
'enabled' => true,
|
||||
'field_name' => '_custom'
|
||||
'field_name' => '_custom',
|
||||
),
|
||||
'form' => array(
|
||||
'enabled' => true,
|
||||
'csrf_protection' => array(
|
||||
'field_name' => '_custom_form'
|
||||
'field_name' => '_custom_form',
|
||||
),
|
||||
),
|
||||
'session' => array(
|
||||
|
@ -54,7 +54,7 @@ $container->loadFromExtension('framework', array(
|
||||
),
|
||||
),
|
||||
'form' => array(
|
||||
'resources' => array('theme1', 'theme2')
|
||||
'resources' => array('theme1', 'theme2'),
|
||||
),
|
||||
'hinclude_default_template' => 'global_hinclude_template',
|
||||
),
|
||||
@ -71,5 +71,5 @@ $container->loadFromExtension('framework', array(
|
||||
'debug' => true,
|
||||
'file_cache_dir' => '%kernel.cache_dir%/annotations',
|
||||
),
|
||||
'ide' => 'file%%link%%format'
|
||||
'ide' => 'file%%link%%format',
|
||||
));
|
||||
|
@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerAware;
|
||||
|
||||
class SessionController extends ContainerAware
|
||||
{
|
||||
public function welcomeAction($name=null)
|
||||
public function welcomeAction($name = null)
|
||||
{
|
||||
$request = $this->container->get('request');
|
||||
$session = $request->getSession();
|
||||
|
@ -24,7 +24,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
|
||||
$routes->add('foo', new Route(
|
||||
' /{_locale}',
|
||||
array(
|
||||
'_locale' => '%locale%'
|
||||
'_locale' => '%locale%',
|
||||
),
|
||||
array(
|
||||
'_locale' => 'en|es',
|
||||
|
@ -19,7 +19,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$container = $this->getContainerMock(array(
|
||||
'engine.first' => $this->getEngineMock('template.php', false),
|
||||
'engine.second' => $this->getEngineMock('template.php', true)
|
||||
'engine.second' => $this->getEngineMock('template.php', true),
|
||||
));
|
||||
|
||||
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
|
||||
@ -33,7 +33,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
|
||||
$secondEngine = $this->getEngineMock('template.php', true);
|
||||
$container = $this->getContainerMock(array(
|
||||
'engine.first' => $firstEngine,
|
||||
'engine.second' => $secondEngine
|
||||
'engine.second' => $secondEngine,
|
||||
));
|
||||
|
||||
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
|
||||
@ -51,7 +51,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
|
||||
$secondEngine = $this->getEngineMock('template.php', false);
|
||||
$container = $this->getContainerMock(array(
|
||||
'engine.first' => $firstEngine,
|
||||
'engine.second' => $secondEngine
|
||||
'engine.second' => $secondEngine,
|
||||
));
|
||||
|
||||
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
|
||||
|
@ -112,14 +112,14 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
|
||||
public static function themeBlockInheritanceProvider()
|
||||
{
|
||||
return array(
|
||||
array(array('TestBundle:Parent'))
|
||||
array(array('TestBundle:Parent')),
|
||||
);
|
||||
}
|
||||
|
||||
public static function themeInheritanceProvider()
|
||||
{
|
||||
return array(
|
||||
array(array('TestBundle:Parent'), array('TestBundle:Child'))
|
||||
array(array('TestBundle:Parent'), array('TestBundle:Child')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,4 @@
|
||||
<?php if (!$label) { $label = $view['form']->humanize($name); } ?>
|
||||
<?php if (!$label) {
|
||||
$label = $view['form']->humanize($name);
|
||||
} ?>
|
||||
<label>Custom label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>
|
||||
|
@ -183,7 +183,6 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame('en-US', $translator->getLocale());
|
||||
}
|
||||
|
||||
|
||||
protected function getCatalogue($locale, $messages)
|
||||
{
|
||||
$catalogue = new MessageCatalogue($locale);
|
||||
|
@ -96,7 +96,7 @@ class PhpStringTokenParser
|
||||
public static function parseEscapeSequences($str, $quote)
|
||||
{
|
||||
if (null !== $quote) {
|
||||
$str = str_replace('\\' . $quote, $quote, $str);
|
||||
$str = str_replace('\\'.$quote, $quote, $str);
|
||||
}
|
||||
|
||||
return preg_replace_callback(
|
||||
|
@ -337,11 +337,11 @@ class MainConfiguration implements ConfigurationInterface
|
||||
'memory' => array(
|
||||
'users' => array(
|
||||
'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'),
|
||||
'bar' => array('password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]')
|
||||
'bar' => array('password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]'),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username'))
|
||||
'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')),
|
||||
))
|
||||
->disallowNewKeysInSubsequentConfigs()
|
||||
->isRequired()
|
||||
@ -398,8 +398,8 @@ class MainConfiguration implements ConfigurationInterface
|
||||
'Acme\DemoBundle\Entity\User2' => array(
|
||||
'algorithm' => 'sha512',
|
||||
'encode_as_base64' => 'true',
|
||||
'iterations'=> 5000
|
||||
)
|
||||
'iterations' => 5000,
|
||||
),
|
||||
))
|
||||
->requiresAtLeastOneElement()
|
||||
->useAttributeAsKey('class')
|
||||
|
@ -61,7 +61,7 @@ class RememberMeFactory implements SecurityFactoryInterface
|
||||
|
||||
if (isset($config['token_provider'])) {
|
||||
$rememberMeServices->addMethodCall('setTokenProvider', array(
|
||||
new Reference($config['token_provider'])
|
||||
new Reference($config['token_provider']),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ class SecurityExtension extends Extension
|
||||
->addTag('doctrine.event_listener', array(
|
||||
'connection' => $config['connection'],
|
||||
'event' => 'postGenerateSchema',
|
||||
'lazy' => true
|
||||
'lazy' => true,
|
||||
))
|
||||
;
|
||||
|
||||
|
@ -5,5 +5,5 @@ $this->load('container1.php', $container);
|
||||
$container->loadFromExtension('security', array(
|
||||
'acl' => array(
|
||||
'provider' => 'foo',
|
||||
)
|
||||
),
|
||||
));
|
||||
|
@ -16,5 +16,5 @@ $container->loadFromExtension('security', array(
|
||||
|
||||
'role_hierarchy' => array(
|
||||
'FOO' => array('MOO'),
|
||||
)
|
||||
),
|
||||
));
|
||||
|
@ -5,8 +5,8 @@ $container->loadFromExtension('security', array(
|
||||
'main' => array(
|
||||
'form_login' => array(
|
||||
'login_path' => '/login',
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'role_hierarchy' => array(
|
||||
'FOO' => 'BAR',
|
||||
|
@ -35,9 +35,9 @@ class SecurityExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
'pattern' => '/secured_area/.*',
|
||||
'form_login' => array(
|
||||
'check_path' => '/some_area/login_check',
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
$container->compile();
|
||||
@ -59,8 +59,8 @@ class SecurityExtensionTest extends \PHPUnit_Framework_TestCase
|
||||
'firewalls' => array(
|
||||
'some_firewall' => array(
|
||||
'pattern' => '/.*',
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
$container->compile();
|
||||
|
@ -96,22 +96,22 @@ class SecurityRoutingIntegrationTest extends WebTestCase
|
||||
*/
|
||||
public function testSecurityConfigurationForExpression($config)
|
||||
{
|
||||
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0'));
|
||||
$this->assertAllowed($allowedClient, '/protected-via-expression');
|
||||
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0'));
|
||||
$this->assertAllowed($allowedClient, '/protected-via-expression');
|
||||
|
||||
$barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
|
||||
$this->assertRestricted($barredClient, '/protected-via-expression');
|
||||
$barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
|
||||
$this->assertRestricted($barredClient, '/protected-via-expression');
|
||||
|
||||
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
|
||||
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
|
||||
|
||||
$allowedClient->request('GET', '/protected-via-expression');
|
||||
$form = $allowedClient->followRedirect()->selectButton('login')->form();
|
||||
$form['_username'] = 'johannes';
|
||||
$form['_password'] = 'test';
|
||||
$allowedClient->submit($form);
|
||||
$this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression');
|
||||
$this->assertAllowed($allowedClient, '/protected-via-expression');
|
||||
}
|
||||
$allowedClient->request('GET', '/protected-via-expression');
|
||||
$form = $allowedClient->followRedirect()->selectButton('login')->form();
|
||||
$form['_username'] = 'johannes';
|
||||
$form['_password'] = 'test';
|
||||
$allowedClient->submit($form);
|
||||
$this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression');
|
||||
$this->assertAllowed($allowedClient, '/protected-via-expression');
|
||||
}
|
||||
|
||||
private function assertAllowed($client, $path)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ class TwigExtension extends Extension
|
||||
if (is_array($value) && isset($value['key'])) {
|
||||
$config['globals'][$name] = array(
|
||||
'key' => $name,
|
||||
'value' => $config['globals'][$name]
|
||||
'value' => $config['globals'][$name],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ $container->loadFromExtension('twig', array(
|
||||
'form' => array(
|
||||
'resources' => array(
|
||||
'MyBundle::form.html.twig',
|
||||
)
|
||||
),
|
||||
),
|
||||
'globals' => array(
|
||||
'foo' => '@bar',
|
||||
|
@ -40,7 +40,7 @@ class RenderTokenParserTest extends TestCase
|
||||
new \Twig_Node_Expression_Array(array(), 1),
|
||||
1,
|
||||
'render'
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'{% render "foo", {foo: 1} %}',
|
||||
@ -52,7 +52,7 @@ class RenderTokenParserTest extends TestCase
|
||||
), 1),
|
||||
1,
|
||||
'render'
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ class ProfilerController
|
||||
$this->profiler->disable();
|
||||
|
||||
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
|
||||
'about' => $about
|
||||
'about' => $about,
|
||||
)), 200, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Command;
|
||||
|
||||
use Symfony\Bundle\WebProfilerBundle\Command\ExportCommand;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\HttpKernel\Profiler\Profile;
|
||||
|
||||
class ExportCommandTest extends \PHPUnit_Framework_TestCase
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Command;
|
||||
|
||||
use Symfony\Bundle\WebProfilerBundle\Command\ImportCommand;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\HttpKernel\Profiler\Profile;
|
||||
|
||||
class ImportCommandTest extends \PHPUnit_Framework_TestCase
|
||||
|
@ -48,9 +48,9 @@ class TemplateManagerTest extends TestCase
|
||||
$profiler = $this->mockProfiler();
|
||||
$twigEnvironment = $this->mockTwigEnvironment();
|
||||
$templates = array(
|
||||
'data_collector.foo'=>array('foo','FooBundle:Collector:foo'),
|
||||
'data_collector.bar'=>array('bar','FooBundle:Collector:bar'),
|
||||
'data_collector.baz'=>array('baz','FooBundle:Collector:baz')
|
||||
'data_collector.foo' => array('foo','FooBundle:Collector:foo'),
|
||||
'data_collector.bar' => array('bar','FooBundle:Collector:bar'),
|
||||
'data_collector.baz' => array('baz','FooBundle:Collector:baz'),
|
||||
);
|
||||
|
||||
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
|
||||
|
@ -466,7 +466,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
'HTTP_HOST' => 'www.example.com:8080',
|
||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||
'HTTPS' => false,
|
||||
'HTTP_REFERER' => 'http://www.example.com:8080/'
|
||||
'HTTP_REFERER' => 'http://www.example.com:8080/',
|
||||
);
|
||||
|
||||
$client = new TestClient();
|
||||
@ -600,7 +600,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
'HTTP_HOST' => 'testhost',
|
||||
'HTTP_USER_AGENT' => 'testua',
|
||||
'HTTPS' => false,
|
||||
'NEW_SERVER_KEY' => 'new-server-key-value'
|
||||
'NEW_SERVER_KEY' => 'new-server-key-value',
|
||||
));
|
||||
|
||||
$this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST'));
|
||||
|
@ -61,13 +61,13 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$headers = array(
|
||||
'content-type' => 'text/html; charset=utf-8',
|
||||
'set-cookie' => array('foo=bar', 'bar=foo')
|
||||
'set-cookie' => array('foo=bar', 'bar=foo'),
|
||||
);
|
||||
|
||||
$expected = 'content-type: text/html; charset=utf-8'."\n";
|
||||
$expected.= 'set-cookie: foo=bar'."\n";
|
||||
$expected.= 'set-cookie: bar=foo'."\n\n";
|
||||
$expected.= 'foo';
|
||||
$expected .= 'set-cookie: foo=bar'."\n";
|
||||
$expected .= 'set-cookie: bar=foo'."\n\n";
|
||||
$expected .= 'foo';
|
||||
|
||||
$response = new Response('foo', 304, $headers);
|
||||
|
||||
|
@ -71,7 +71,6 @@ class ClassMapGenerator
|
||||
foreach ($classes as $class) {
|
||||
$map[$class] = $path;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $map;
|
||||
|
@ -55,15 +55,15 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(class_exists($className), $message);
|
||||
}
|
||||
|
||||
public function getLoadClassTests()
|
||||
{
|
||||
return array(
|
||||
public function getLoadClassTests()
|
||||
{
|
||||
return array(
|
||||
array('\\Apc\\Namespaced\\Foo', '\\Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'),
|
||||
array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'),
|
||||
array('\\Apc\\Namespaced\\Bar', '\\Apc\\Namespaced\\Bar', '->loadClass() loads Apc\Namespaced\Bar class with a leading slash'),
|
||||
array('Apc_Pearlike_Bar', '\\Apc_Pearlike_Bar', '->loadClass() loads Apc_Pearlike_Bar class with a leading slash'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getLoadClassFromFallbackTests
|
||||
@ -79,15 +79,15 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(class_exists($className), $message);
|
||||
}
|
||||
|
||||
public function getLoadClassFromFallbackTests()
|
||||
{
|
||||
return array(
|
||||
public function getLoadClassFromFallbackTests()
|
||||
{
|
||||
return array(
|
||||
array('\\Apc\\Namespaced\\Baz', '\\Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'),
|
||||
array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'),
|
||||
array('\\Apc\\Namespaced\\FooBar', '\\Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'),
|
||||
array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getLoadClassNamespaceCollisionTests
|
||||
@ -102,9 +102,9 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(class_exists($className), $message);
|
||||
}
|
||||
|
||||
public function getLoadClassNamespaceCollisionTests()
|
||||
{
|
||||
return array(
|
||||
public function getLoadClassNamespaceCollisionTests()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
|
||||
@ -138,7 +138,7 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
'->loadClass() loads NamespaceCollision\A\B\Bar from beta.',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getLoadClassPrefixCollisionTests
|
||||
@ -152,9 +152,9 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(class_exists($className), $message);
|
||||
}
|
||||
|
||||
public function getLoadClassPrefixCollisionTests()
|
||||
{
|
||||
return array(
|
||||
public function getLoadClassPrefixCollisionTests()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
|
||||
@ -188,5 +188,5 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
'->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
|
||||
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
|
||||
'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
|
||||
)
|
||||
),
|
||||
),
|
||||
array(__DIR__.'/Fixtures/beta/NamespaceCollision', array(
|
||||
'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
namespace ClassesWithParents;
|
||||
|
||||
class A extends B {}
|
||||
class A extends B
|
||||
{
|
||||
}
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
namespace ClassesWithParents;
|
||||
|
||||
class B implements CInterface {}
|
||||
class B implements CInterface
|
||||
{
|
||||
}
|
||||
|
@ -13,5 +13,4 @@ namespace ClassMap;
|
||||
|
||||
class SomeClass extends SomeParent implements SomeInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -13,5 +13,4 @@ namespace ClassMap;
|
||||
|
||||
interface SomeInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -13,5 +13,4 @@ namespace ClassMap;
|
||||
|
||||
abstract class SomeParent
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,24 @@
|
||||
<?php
|
||||
namespace {
|
||||
class A {}
|
||||
class A
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
namespace Alpha {
|
||||
class A {}
|
||||
class B {}
|
||||
class A
|
||||
{
|
||||
}
|
||||
class B
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beta {
|
||||
class A {}
|
||||
class B {}
|
||||
class A
|
||||
{
|
||||
}
|
||||
class B
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -11,5 +11,9 @@
|
||||
|
||||
namespace Foo\Bar;
|
||||
|
||||
class A {}
|
||||
class B {}
|
||||
class A
|
||||
{
|
||||
}
|
||||
class B
|
||||
{
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
trait TD
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
trait TZ
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ namespace Foo {
|
||||
|
||||
class CBar implements IBar
|
||||
{
|
||||
use TBar, TFooBar;
|
||||
use TBar;
|
||||
use TFooBar;
|
||||
}
|
||||
}
|
||||
|
@ -287,7 +287,6 @@ class UniversalClassLoader
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
||||
|
@ -113,5 +113,4 @@ class ConfigCache
|
||||
{
|
||||
return $this->file.'.meta';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,5 +39,4 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
|
||||
{
|
||||
return new BooleanNode($this->name, $this->parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -243,5 +243,4 @@ class NodeBuilder implements NodeParentInterface
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -340,5 +340,4 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
* @throws InvalidDefinitionException When the definition is invalid
|
||||
*/
|
||||
abstract protected function createNode();
|
||||
|
||||
}
|
||||
|
@ -61,5 +61,4 @@ class VariableNodeDefinition extends NodeDefinition
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ class YamlReferenceDumper
|
||||
if ($info = $node->getInfo()) {
|
||||
$this->writeLine('');
|
||||
// indenting multi-line info
|
||||
$info = str_replace("\n", sprintf("\n%".$depth * 4 . "s# ", ' '), $info);
|
||||
$info = str_replace("\n", sprintf("\n%".($depth * 4)."s# ", ' '), $info);
|
||||
$this->writeLine('# '.$info, $depth * 4);
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ class PrototypedArrayNode extends ArrayNode
|
||||
if (!array_key_exists($k, $leftSide)) {
|
||||
if (!$this->allowNewKeys) {
|
||||
$ex = new InvalidConfigurationException(sprintf(
|
||||
'You are not allowed to define new elements for path "%s". ' .
|
||||
'You are not allowed to define new elements for path "%s". '.
|
||||
'Please define all elements for this path in one config file.',
|
||||
$this->getPath()
|
||||
));
|
||||
|
@ -49,5 +49,4 @@ interface LoaderInterface
|
||||
* @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
|
||||
*/
|
||||
public function setResolver(LoaderResolverInterface $resolver);
|
||||
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase
|
||||
array(
|
||||
array('foo-bar' => null, 'foo_bar' => 'foo'),
|
||||
array('foo-bar' => null, 'foo_bar' => 'foo'),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class ArrayNodeDefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
array('defaultValue', array(array())),
|
||||
array('addDefaultChildrenIfNoneSet', array()),
|
||||
array('requiresAtLeastOneElement', array()),
|
||||
array('useAttributeAsKey', array('foo'))
|
||||
array('useAttributeAsKey', array('foo')),
|
||||
);
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user