fixed CS
This commit is contained in:
parent
f5d4515200
commit
369aebf431
@ -207,11 +207,11 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
} elseif ($driverType == 'annotation') {
|
} elseif ($driverType == 'annotation') {
|
||||||
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
|
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
|
||||||
new Reference($this->getObjectManagerElementName('metadata.annotation_reader')),
|
new Reference($this->getObjectManagerElementName('metadata.annotation_reader')),
|
||||||
array_values($driverPaths)
|
array_values($driverPaths),
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
|
$mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array(
|
||||||
array_values($driverPaths)
|
array_values($driverPaths),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
$mappingDriverDef->setPublic(false);
|
$mappingDriverDef->setPublic(false);
|
||||||
@ -320,7 +320,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
$cacheDef = new Definition($memcacheClass);
|
$cacheDef = new Definition($memcacheClass);
|
||||||
$memcacheInstance = new Definition($memcacheInstanceClass);
|
$memcacheInstance = new Definition($memcacheInstanceClass);
|
||||||
$memcacheInstance->addMethodCall('connect', array(
|
$memcacheInstance->addMethodCall('connect', array(
|
||||||
$memcacheHost, $memcachePort
|
$memcacheHost, $memcachePort,
|
||||||
));
|
));
|
||||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name'])), $memcacheInstance);
|
$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'])))));
|
$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);
|
$cacheDef = new Definition($memcachedClass);
|
||||||
$memcachedInstance = new Definition($memcachedInstanceClass);
|
$memcachedInstance = new Definition($memcachedInstanceClass);
|
||||||
$memcachedInstance->addMethodCall('addServer', array(
|
$memcachedInstance->addMethodCall('addServer', array(
|
||||||
$memcachedHost, $memcachedPort
|
$memcachedHost, $memcachedPort,
|
||||||
));
|
));
|
||||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])), $memcachedInstance);
|
$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'])))));
|
$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);
|
$cacheDef = new Definition($redisClass);
|
||||||
$redisInstance = new Definition($redisInstanceClass);
|
$redisInstance = new Definition($redisInstanceClass);
|
||||||
$redisInstance->addMethodCall('connect', array(
|
$redisInstance->addMethodCall('connect', array(
|
||||||
$redisHost, $redisPort
|
$redisHost, $redisPort,
|
||||||
));
|
));
|
||||||
$container->setDefinition($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])), $redisInstance);
|
$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'])))));
|
$cacheDef->addMethodCall('setRedis', array(new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])))));
|
||||||
|
@ -121,7 +121,7 @@ abstract class DoctrineType extends AbstractType
|
|||||||
$loaderHash,
|
$loaderHash,
|
||||||
$choiceHashes,
|
$choiceHashes,
|
||||||
$preferredChoiceHashes,
|
$preferredChoiceHashes,
|
||||||
$groupByHash
|
$groupByHash,
|
||||||
)));
|
)));
|
||||||
|
|
||||||
if (!isset($choiceListCache[$hash])) {
|
if (!isset($choiceListCache[$hash])) {
|
||||||
|
@ -98,10 +98,10 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
.' WHERE series=:series';
|
.' WHERE series=:series';
|
||||||
$paramValues = array('value' => $tokenValue,
|
$paramValues = array('value' => $tokenValue,
|
||||||
'lastUsed' => $lastUsed,
|
'lastUsed' => $lastUsed,
|
||||||
'series' => $series);
|
'series' => $series,);
|
||||||
$paramTypes = array('value' => \PDO::PARAM_STR,
|
$paramTypes = array('value' => \PDO::PARAM_STR,
|
||||||
'lastUsed' => DoctrineType::DATETIME,
|
'lastUsed' => DoctrineType::DATETIME,
|
||||||
'series' => \PDO::PARAM_STR);
|
'series' => \PDO::PARAM_STR,);
|
||||||
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||||
if ($updated < 1) {
|
if ($updated < 1) {
|
||||||
throw new TokenNotFoundException('No token found.');
|
throw new TokenNotFoundException('No token found.');
|
||||||
@ -120,12 +120,12 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
'username' => $token->getUsername(),
|
'username' => $token->getUsername(),
|
||||||
'series' => $token->getSeries(),
|
'series' => $token->getSeries(),
|
||||||
'value' => $token->getTokenValue(),
|
'value' => $token->getTokenValue(),
|
||||||
'lastUsed' => $token->getLastUsed());
|
'lastUsed' => $token->getLastUsed(),);
|
||||||
$paramTypes = array('class' => \PDO::PARAM_STR,
|
$paramTypes = array('class' => \PDO::PARAM_STR,
|
||||||
'username' => \PDO::PARAM_STR,
|
'username' => \PDO::PARAM_STR,
|
||||||
'series' => \PDO::PARAM_STR,
|
'series' => \PDO::PARAM_STR,
|
||||||
'value' => \PDO::PARAM_STR,
|
'value' => \PDO::PARAM_STR,
|
||||||
'lastUsed' => DoctrineType::DATETIME);
|
'lastUsed' => DoctrineType::DATETIME,);
|
||||||
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(0, $c->getQueryCount());
|
$this->assertEquals(0, $c->getQueryCount());
|
||||||
|
|
||||||
$queries = array(
|
$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 = $this->createCollector($queries);
|
||||||
$c->collect(new Request(), new Response());
|
$c->collect(new Request(), new Response());
|
||||||
@ -64,7 +64,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(0, $c->getTime());
|
$this->assertEquals(0, $c->getTime());
|
||||||
|
|
||||||
$queries = array(
|
$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 = $this->createCollector($queries);
|
||||||
$c->collect(new Request(), new Response());
|
$c->collect(new Request(), new Response());
|
||||||
@ -72,7 +72,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$queries = array(
|
$queries = array(
|
||||||
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1),
|
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 = $this->createCollector($queries);
|
||||||
$c->collect(new Request(), new Response());
|
$c->collect(new Request(), new Response());
|
||||||
@ -85,7 +85,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testCollectQueries($param, $types, $expected, $explainable)
|
public function testCollectQueries($param, $types, $expected, $explainable)
|
||||||
{
|
{
|
||||||
$queries = array(
|
$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 = $this->createCollector($queries);
|
||||||
$c->collect(new Request(), new Response());
|
$c->collect(new Request(), new Response());
|
||||||
@ -101,7 +101,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testSerialization($param, $types, $expected, $explainable)
|
public function testSerialization($param, $types, $expected, $explainable)
|
||||||
{
|
{
|
||||||
$queries = array(
|
$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 = $this->createCollector($queries);
|
||||||
$c->collect(new Request(), new Response());
|
$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->assertSame(array(1 => $entity1, 2 => $entity2), $choiceList->getChoices());
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'group1' => array(1 => new ChoiceView($entity1, '1', 'Foo')),
|
'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());
|
), $choiceList->getRemainingViews());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
||||||
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
||||||
4 => new ChoiceView($item4, '4', 'Boo!')
|
4 => new ChoiceView($item4, '4', 'Boo!'),
|
||||||
), $choiceList->getRemainingViews());
|
), $choiceList->getRemainingViews());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
1 => $item1,
|
1 => $item1,
|
||||||
2 => $item2
|
2 => $item2,
|
||||||
), $choiceList->getChoices());
|
), $choiceList->getChoices());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,5 +94,4 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
return new DoctrineOrmTypeGuesser($registry);
|
return new DoctrineOrmTypeGuesser($registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
new CoreExtension(),
|
new CoreExtension(),
|
||||||
new DoctrineOrmExtension($manager)
|
new DoctrineOrmExtension($manager),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class EntityTypeTest extends TypeTestCase
|
|||||||
'em' => 'default',
|
'em' => 'default',
|
||||||
'class' => self::SINGLE_IDENT_CLASS,
|
'class' => self::SINGLE_IDENT_CLASS,
|
||||||
'required' => false,
|
'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']);
|
$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,
|
'class' => self::SINGLE_IDENT_CLASS,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'property' => 'name',
|
'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']);
|
$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(
|
$this->assertEquals(array(
|
||||||
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
||||||
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
||||||
'4' => new ChoiceView($item4, '4', 'Boo!')
|
'4' => new ChoiceView($item4, '4', 'Boo!'),
|
||||||
), $field->createView()->vars['choices']);
|
), $field->createView()->vars['choices']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -754,7 +754,7 @@ class EntityTypeTest extends TypeTestCase
|
|||||||
$this->factory->createNamed('name', 'entity', null, array(
|
$this->factory->createNamed('name', 'entity', null, array(
|
||||||
'class' => self::SINGLE_IDENT_CLASS,
|
'class' => self::SINGLE_IDENT_CLASS,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'property' => 'name'
|
'property' => 'name',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,5 +138,4 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'long' => $longString,
|
'long' => $longString,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ class ChromePhpHandler extends BaseChromePhpHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('{\bChrome/\d+[\.\d+]*\b}', $event->getRequest()->headers->get('User-Agent'))) {
|
if (!preg_match('{\bChrome/\d+[\.\d+]*\b}', $event->getRequest()->headers->get('User-Agent'))) {
|
||||||
|
|
||||||
$this->sendHeaders = false;
|
$this->sendHeaders = false;
|
||||||
$this->headers = array();
|
$this->headers = array();
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ class FirePHPHandler extends BaseFirePHPHandler
|
|||||||
|
|
||||||
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))
|
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))
|
||||||
&& !$event->getRequest()->headers->has('X-FirePHP-Version')) {
|
&& !$event->getRequest()->headers->has('X-FirePHP-Version')) {
|
||||||
|
|
||||||
$this->sendHeaders = false;
|
$this->sendHeaders = false;
|
||||||
$this->headers = array();
|
$this->headers = array();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class WebProcessorTest extends \PHPUnit_Framework_TestCase
|
|||||||
'REMOTE_ADDR' => 'B',
|
'REMOTE_ADDR' => 'B',
|
||||||
'REQUEST_METHOD' => 'C',
|
'REQUEST_METHOD' => 'C',
|
||||||
'SERVER_NAME' => 'D',
|
'SERVER_NAME' => 'D',
|
||||||
'HTTP_REFERER' => 'E'
|
'HTTP_REFERER' => 'E',
|
||||||
);
|
);
|
||||||
|
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
|
@ -22,7 +22,6 @@ use Symfony\Component\Form\FormEvent;
|
|||||||
*/
|
*/
|
||||||
class TranslationCollectionFormListener implements EventSubscriberInterface
|
class TranslationCollectionFormListener implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
private $i18nClass;
|
private $i18nClass;
|
||||||
private $languages;
|
private $languages;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class TranslationFormListener implements EventSubscriberInterface
|
|||||||
$customOptions = $options['options'];
|
$customOptions = $options['options'];
|
||||||
}
|
}
|
||||||
$options = array(
|
$options = array(
|
||||||
'label' => $label.' '.strtoupper($data->getLocale())
|
'label' => $label.' '.strtoupper($data->getLocale()),
|
||||||
);
|
);
|
||||||
|
|
||||||
$options = array_merge($options, $customOptions);
|
$options = array_merge($options, $customOptions);
|
||||||
|
@ -26,7 +26,7 @@ class PropelExtension extends AbstractExtension
|
|||||||
return array(
|
return array(
|
||||||
new Type\ModelType(PropertyAccess::createPropertyAccessor()),
|
new Type\ModelType(PropertyAccess::createPropertyAccessor()),
|
||||||
new Type\TranslationCollectionType(),
|
new Type\TranslationCollectionType(),
|
||||||
new Type\TranslationType()
|
new Type\TranslationType(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class TranslationCollectionType extends AbstractType
|
|||||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setRequired(array(
|
$resolver->setRequired(array(
|
||||||
'languages'
|
'languages',
|
||||||
));
|
));
|
||||||
|
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
@ -68,8 +68,8 @@ class TranslationCollectionType extends AbstractType
|
|||||||
'allow_delete' => false,
|
'allow_delete' => false,
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'data_class' => null,
|
'data_class' => null,
|
||||||
'columns' => null
|
'columns' => null,
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class TranslationType extends AbstractType
|
|||||||
{
|
{
|
||||||
$resolver->setRequired(array(
|
$resolver->setRequired(array(
|
||||||
'data_class',
|
'data_class',
|
||||||
'columns'
|
'columns',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ class PropelDataCollectorTest extends Propel1TestCase
|
|||||||
'sql' => "SET NAMES 'utf8'",
|
'sql' => "SET NAMES 'utf8'",
|
||||||
'time' => '0.000 sec',
|
'time' => '0.000 sec',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'memory' => '1.4 MB'
|
'memory' => '1.4 MB',
|
||||||
)
|
),
|
||||||
), $c->getQueries());
|
), $c->getQueries());
|
||||||
$this->assertEquals(1, $c->getQueryCount());
|
$this->assertEquals(1, $c->getQueryCount());
|
||||||
}
|
}
|
||||||
@ -70,19 +70,19 @@ class PropelDataCollectorTest extends Propel1TestCase
|
|||||||
'sql' => "SET NAMES 'utf8'",
|
'sql' => "SET NAMES 'utf8'",
|
||||||
'time' => '0.000 sec',
|
'time' => '0.000 sec',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'memory' => '1.4 MB'
|
'memory' => '1.4 MB',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
|
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
|
||||||
'time' => '0.012 sec',
|
'time' => '0.012 sec',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'memory' => '2.4 MB'
|
'memory' => '2.4 MB',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
|
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
|
||||||
'time' => '0.012 sec',
|
'time' => '0.012 sec',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'memory' => '2.4 MB'
|
'memory' => '2.4 MB',
|
||||||
),
|
),
|
||||||
), $c->getQueries());
|
), $c->getQueries());
|
||||||
$this->assertEquals(3, $c->getQueryCount());
|
$this->assertEquals(3, $c->getQueryCount());
|
||||||
|
@ -96,7 +96,7 @@ class ItemQuery
|
|||||||
return array(
|
return array(
|
||||||
$mainAuthorRelation,
|
$mainAuthorRelation,
|
||||||
$authorRelation,
|
$authorRelation,
|
||||||
$resellerRelation
|
$resellerRelation,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,6 @@ class TranslatableItemI18n implements \Persistent
|
|||||||
|
|
||||||
public function setLocale($locale)
|
public function setLocale($locale)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->locale = $locale;
|
$this->locale = $locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +114,6 @@ class TranslatableItemI18n implements \Persistent
|
|||||||
|
|
||||||
public function setValue($value)
|
public function setValue($value)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +124,6 @@ class TranslatableItemI18n implements \Persistent
|
|||||||
|
|
||||||
public function setValue2($value2)
|
public function setValue2($value2)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->value2 = $value2;
|
$this->value2 = $value2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
array(
|
array(
|
||||||
$item1
|
$item1,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
|||||||
$this->assertSame(array(1 => $item1, 2 => $item2), $choiceList->getChoices());
|
$this->assertSame(array(1 => $item1, 2 => $item2), $choiceList->getChoices());
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'group1' => array(1 => new ChoiceView($item1, '1', 'Foo')),
|
'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());
|
), $choiceList->getRemainingViews());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
|||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
||||||
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
||||||
4 => new ChoiceView($item4, '4', 'Boo!')
|
4 => new ChoiceView($item4, '4', 'Boo!'),
|
||||||
), $choiceList->getRemainingViews());
|
), $choiceList->getRemainingViews());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ class ModelChoiceListTest extends Propel1TestCase
|
|||||||
|
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
1 => $item1,
|
1 => $item1,
|
||||||
2 => $item2
|
2 => $item2,
|
||||||
), $choiceList->getChoices());
|
), $choiceList->getChoices());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,4 +108,6 @@ class CollectionToArrayTransformerTest extends Propel1TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DummyObject {}
|
class DummyObject
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -42,15 +42,15 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
|||||||
$item->addTranslatableItemI18n(new TranslatableItemI18n(2, 'en', 'val2'));
|
$item->addTranslatableItemI18n(new TranslatableItemI18n(2, 'en', 'val2'));
|
||||||
|
|
||||||
$builder = $this->factory->createBuilder('form', null, array(
|
$builder = $this->factory->createBuilder('form', null, array(
|
||||||
'data_class' => self::TRANSLATION_CLASS
|
'data_class' => self::TRANSLATION_CLASS,
|
||||||
));
|
));
|
||||||
|
|
||||||
$builder->add('translatableItemI18ns', 'propel1_translation_collection', array(
|
$builder->add('translatableItemI18ns', 'propel1_translation_collection', array(
|
||||||
'languages' => array('en', 'fr'),
|
'languages' => array('en', 'fr'),
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
'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 = $builder->getForm();
|
||||||
$form->setData($item);
|
$form->setData($item);
|
||||||
@ -79,14 +79,14 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
|||||||
$this->assertCount(0, $item->getTranslatableItemI18ns());
|
$this->assertCount(0, $item->getTranslatableItemI18ns());
|
||||||
|
|
||||||
$builder = $this->factory->createBuilder('form', null, array(
|
$builder = $this->factory->createBuilder('form', null, array(
|
||||||
'data_class' => self::TRANSLATION_CLASS
|
'data_class' => self::TRANSLATION_CLASS,
|
||||||
));
|
));
|
||||||
$builder->add('translatableItemI18ns', 'propel1_translation_collection', array(
|
$builder->add('translatableItemI18ns', 'propel1_translation_collection', array(
|
||||||
'languages' => array('en', 'fr'),
|
'languages' => array('en', 'fr'),
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
'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 = $builder->getForm();
|
||||||
@ -103,14 +103,14 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
|||||||
$item = new Item(null, 'val');
|
$item = new Item(null, 'val');
|
||||||
|
|
||||||
$builder = $this->factory->createBuilder('form', null, array(
|
$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(
|
$builder->add('value', 'propel1_translation_collection', array(
|
||||||
'languages' => array('en', 'fr'),
|
'languages' => array('en', 'fr'),
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
'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 = $builder->getForm();
|
||||||
@ -125,8 +125,8 @@ class TranslationCollectionTypeTest extends TypeTestCase
|
|||||||
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
||||||
'languages' => array('en', 'fr'),
|
'languages' => array('en', 'fr'),
|
||||||
'options' => array(
|
'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(
|
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
'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(
|
$this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array(
|
||||||
'languages' => array('en', 'fr'),
|
'languages' => array('en', 'fr'),
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'data_class' => self::TRANSLATABLE_I18N_CLASS
|
'data_class' => self::TRANSLATABLE_I18N_CLASS,
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,6 @@ class LazyServiceProjectServiceContainer extends Container
|
|||||||
|
|
||||||
class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \ProxyManager\Proxy\LazyLoadingInterface, \ProxyManager\Proxy\ValueHolderInterface
|
class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \ProxyManager\Proxy\LazyLoadingInterface, \ProxyManager\Proxy\ValueHolderInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Closure|null initializer responsible for generating the wrapped object
|
* @var \Closure|null initializer responsible for generating the wrapped object
|
||||||
*/
|
*/
|
||||||
@ -193,5 +192,4 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr
|
|||||||
{
|
{
|
||||||
return $this->valueHolder5157dd96e88c0;
|
return $this->valueHolder5157dd96e88c0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,5 @@ class FormThemeNode extends \Twig_Node
|
|||||||
->raw(', ')
|
->raw(', ')
|
||||||
->subcompile($this->getNode('resources'))
|
->subcompile($this->getNode('resources'))
|
||||||
->raw(");\n");
|
->raw(");\n");
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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('F\Q\N\Foo::Method', '<abbr title="F\Q\N\Foo">Foo</abbr>::Method()'),
|
||||||
array('Bare::Method', '<abbr title="Bare">Bare</abbr>::Method()'),
|
array('Bare::Method', '<abbr title="Bare">Bare</abbr>::Method()'),
|
||||||
array('Closure', '<abbr title="Closure">Closure</abbr>'),
|
array('Closure', '<abbr title="Closure">Closure</abbr>'),
|
||||||
array('Method', '<abbr title="Method">Method</abbr>()')
|
array('Method', '<abbr title="Method">Method</abbr>()'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,14 +210,14 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
|
|||||||
public static function themeBlockInheritanceProvider()
|
public static function themeBlockInheritanceProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(array('theme.html.twig'))
|
array(array('theme.html.twig')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function themeInheritanceProvider()
|
public static function themeInheritanceProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(array('parent_label.html.twig'), array('child_label.html.twig'))
|
array(array('parent_label.html.twig'), array('child_label.html.twig')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,17 +101,17 @@ class TranslationExtensionTest extends TestCase
|
|||||||
|
|
||||||
// transchoice
|
// transchoice
|
||||||
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
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 %}',
|
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 %}',
|
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 %}',
|
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 %}',
|
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 %}',
|
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
|
// trans filter
|
||||||
array('{{ "Hello"|trans }}', 'Hello'),
|
array('{{ "Hello"|trans }}', 'Hello'),
|
||||||
|
@ -21,7 +21,7 @@ class FormThemeTest extends TestCase
|
|||||||
$form = new \Twig_Node_Expression_Name('form', 0);
|
$form = new \Twig_Node_Expression_Name('form', 0);
|
||||||
$resources = new \Twig_Node(array(
|
$resources = new \Twig_Node(array(
|
||||||
new \Twig_Node_Expression_Constant('tpl1', 0),
|
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);
|
$node = new FormThemeNode($form, $resources, 0);
|
||||||
@ -37,7 +37,7 @@ class FormThemeTest extends TestCase
|
|||||||
new \Twig_Node_Expression_Constant(0, 0),
|
new \Twig_Node_Expression_Constant(0, 0),
|
||||||
new \Twig_Node_Expression_Constant('tpl1', 0),
|
new \Twig_Node_Expression_Constant('tpl1', 0),
|
||||||
new \Twig_Node_Expression_Constant(1, 0),
|
new \Twig_Node_Expression_Constant(1, 0),
|
||||||
new \Twig_Node_Expression_Constant('tpl2', 0)
|
new \Twig_Node_Expression_Constant('tpl2', 0),
|
||||||
), 0);
|
), 0);
|
||||||
|
|
||||||
$node = new FormThemeNode($form, $resources, 0);
|
$node = new FormThemeNode($form, $resources, 0);
|
||||||
|
@ -43,7 +43,7 @@ class FormThemeTokenParserTest extends TestCase
|
|||||||
), 1),
|
), 1),
|
||||||
1,
|
1,
|
||||||
'form_theme'
|
'form_theme'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'{% form_theme form "tpl1" "tpl2" %}',
|
'{% form_theme form "tpl1" "tpl2" %}',
|
||||||
@ -53,11 +53,11 @@ class FormThemeTokenParserTest extends TestCase
|
|||||||
new \Twig_Node_Expression_Constant(0, 1),
|
new \Twig_Node_Expression_Constant(0, 1),
|
||||||
new \Twig_Node_Expression_Constant('tpl1', 1),
|
new \Twig_Node_Expression_Constant('tpl1', 1),
|
||||||
new \Twig_Node_Expression_Constant(1, 1),
|
new \Twig_Node_Expression_Constant(1, 1),
|
||||||
new \Twig_Node_Expression_Constant('tpl2', 1)
|
new \Twig_Node_Expression_Constant('tpl2', 1),
|
||||||
), 1),
|
), 1),
|
||||||
1,
|
1,
|
||||||
'form_theme'
|
'form_theme'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'{% form_theme form with "tpl1" %}',
|
'{% form_theme form with "tpl1" %}',
|
||||||
@ -66,7 +66,7 @@ class FormThemeTokenParserTest extends TestCase
|
|||||||
new \Twig_Node_Expression_Constant('tpl1', 1),
|
new \Twig_Node_Expression_Constant('tpl1', 1),
|
||||||
1,
|
1,
|
||||||
'form_theme'
|
'form_theme'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'{% form_theme form with ["tpl1"] %}',
|
'{% form_theme form with ["tpl1"] %}',
|
||||||
@ -78,7 +78,7 @@ class FormThemeTokenParserTest extends TestCase
|
|||||||
), 1),
|
), 1),
|
||||||
1,
|
1,
|
||||||
'form_theme'
|
'form_theme'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'{% form_theme form with ["tpl1", "tpl2"] %}',
|
'{% form_theme form with ["tpl1", "tpl2"] %}',
|
||||||
@ -88,11 +88,11 @@ class FormThemeTokenParserTest extends TestCase
|
|||||||
new \Twig_Node_Expression_Constant(0, 1),
|
new \Twig_Node_Expression_Constant(0, 1),
|
||||||
new \Twig_Node_Expression_Constant('tpl1', 1),
|
new \Twig_Node_Expression_Constant('tpl1', 1),
|
||||||
new \Twig_Node_Expression_Constant(1, 1),
|
new \Twig_Node_Expression_Constant(1, 1),
|
||||||
new \Twig_Node_Expression_Constant('tpl2', 1)
|
new \Twig_Node_Expression_Constant('tpl2', 1),
|
||||||
), 1),
|
), 1),
|
||||||
1,
|
1,
|
||||||
'form_theme'
|
'form_theme'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class ConfigDumpReferenceCommand extends ContainerDebugCommand
|
|||||||
$this
|
$this
|
||||||
->setName('config:dump-reference')
|
->setName('config:dump-reference')
|
||||||
->setDefinition(array(
|
->setDefinition(array(
|
||||||
new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias')
|
new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias'),
|
||||||
))
|
))
|
||||||
->setDescription('Dumps default configuration for an extension')
|
->setDescription('Dumps default configuration for an extension')
|
||||||
->setHelp(<<<EOF
|
->setHelp(<<<EOF
|
||||||
|
@ -46,7 +46,7 @@ class ContainerDebugCommand extends ContainerAwareCommand
|
|||||||
new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Show all services with a specific tag'),
|
new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Show all services with a specific tag'),
|
||||||
new InputOption('tags', null, InputOption::VALUE_NONE, 'Displays tagged services for an application'),
|
new InputOption('tags', null, InputOption::VALUE_NONE, 'Displays tagged services for an application'),
|
||||||
new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Displays a specific parameter for an application'),
|
new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Displays a specific parameter for an application'),
|
||||||
new InputOption('parameters', null, InputOption::VALUE_NONE, 'Displays parameters for an application')
|
new InputOption('parameters', null, InputOption::VALUE_NONE, 'Displays parameters for an application'),
|
||||||
))
|
))
|
||||||
->setDescription('Displays current services for an application')
|
->setDescription('Displays current services for an application')
|
||||||
->setHelp(<<<EOF
|
->setHelp(<<<EOF
|
||||||
|
@ -55,7 +55,7 @@ class TranslationUpdateCommand extends ContainerAwareCommand
|
|||||||
new InputOption(
|
new InputOption(
|
||||||
'clean', null, InputOption::VALUE_NONE,
|
'clean', null, InputOption::VALUE_NONE,
|
||||||
'Should clean not found messages'
|
'Should clean not found messages'
|
||||||
)
|
),
|
||||||
))
|
))
|
||||||
->setDescription('Updates the translation file')
|
->setDescription('Updates the translation file')
|
||||||
->setHelp(<<<EOF
|
->setHelp(<<<EOF
|
||||||
|
@ -17,7 +17,6 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
|
|||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the session in the request.
|
* Sets the session in the request.
|
||||||
|
@ -53,5 +53,4 @@ class TemplateFinderTest extends TestCase
|
|||||||
$this->assertContains('::this.is.a.template.format.engine', $templates);
|
$this->assertContains('::this.is.a.template.format.engine', $templates);
|
||||||
$this->assertContains('::resource.format.engine', $templates);
|
$this->assertContains('::resource.format.engine', $templates);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class RedirectControllerTest extends TestCase
|
|||||||
'route' => $route,
|
'route' => $route,
|
||||||
'permanent' => $permanent,
|
'permanent' => $permanent,
|
||||||
'additional-parameter' => 'value',
|
'additional-parameter' => 'value',
|
||||||
'ignoreAttributes' => $ignoreAttributes
|
'ignoreAttributes' => $ignoreAttributes,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
$services = array(
|
$services = array(
|
||||||
'my_cache_warmer_service1' => array(0 => array('priority' => 100)),
|
'my_cache_warmer_service1' => array(0 => array('priority' => 100)),
|
||||||
'my_cache_warmer_service2' => array(0 => array('priority' => 200)),
|
'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');
|
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
|
||||||
@ -46,7 +46,7 @@ class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
->with(0, array(
|
->with(0, array(
|
||||||
new Reference('my_cache_warmer_service2'),
|
new Reference('my_cache_warmer_service2'),
|
||||||
new Reference('my_cache_warmer_service1'),
|
new Reference('my_cache_warmer_service1'),
|
||||||
new Reference('my_cache_warmer_service3')
|
new Reference('my_cache_warmer_service3'),
|
||||||
));
|
));
|
||||||
|
|
||||||
$addCacheWarmerPass = new AddCacheWarmerPass();
|
$addCacheWarmerPass = new AddCacheWarmerPass();
|
||||||
|
@ -22,7 +22,6 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass;
|
|||||||
*/
|
*/
|
||||||
class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testThrowExceptionWhenNoNormalizers()
|
public function testThrowExceptionWhenNoNormalizers()
|
||||||
{
|
{
|
||||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
||||||
@ -75,13 +74,13 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
$services = array(
|
$services = array(
|
||||||
'n3' => array('tag' => array()),
|
'n3' => array('tag' => array()),
|
||||||
'n1' => array('tag' => array('priority' => 200)),
|
'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('n1'),
|
||||||
new Reference('n2'),
|
new Reference('n2'),
|
||||||
new Reference('n3')
|
new Reference('n3'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
|
||||||
|
@ -40,8 +40,6 @@ class TranslatorPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
$container->expects($this->once())
|
$container->expects($this->once())
|
||||||
->method('findDefinition')
|
->method('findDefinition')
|
||||||
->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition')));
|
->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition')));
|
||||||
;
|
|
||||||
|
|
||||||
$pass = new TranslatorPass();
|
$pass = new TranslatorPass();
|
||||||
$pass->process($container);
|
$pass->process($container);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
$config = $processor->processConfiguration($configuration, array(array(
|
$config = $processor->processConfiguration($configuration, array(array(
|
||||||
'secret' => 's3cr3t',
|
'secret' => 's3cr3t',
|
||||||
'trusted_proxies' => $trustedProxies
|
'trusted_proxies' => $trustedProxies,
|
||||||
)));
|
)));
|
||||||
|
|
||||||
$this->assertEquals($processedProxies, $config['trusted_proxies']);
|
$this->assertEquals($processedProxies, $config['trusted_proxies']);
|
||||||
@ -66,8 +66,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||||||
$processor->processConfiguration($configuration, array(
|
$processor->processConfiguration($configuration, array(
|
||||||
array(
|
array(
|
||||||
'secret' => 's3cr3t',
|
'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(
|
$processor->processConfiguration($configuration, array(
|
||||||
array(
|
array(
|
||||||
'secret' => 's3cr3t',
|
'secret' => 's3cr3t',
|
||||||
'trusted_proxies' => array('Not an IP address')
|
'trusted_proxies' => array('Not an IP address'),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,8 +128,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||||||
'debug' => '%kernel.debug%',
|
'debug' => '%kernel.debug%',
|
||||||
),
|
),
|
||||||
'serializer' => array(
|
'serializer' => array(
|
||||||
'enabled' => false
|
'enabled' => false,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,4 @@ namespace Symfony\Bundle\FrameworkBundle\Tests;
|
|||||||
|
|
||||||
class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
|
class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ $container->loadFromExtension('framework', array(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'form' => array(
|
'form' => array(
|
||||||
'resources' => array('theme1', 'theme2')
|
'resources' => array('theme1', 'theme2'),
|
||||||
),
|
),
|
||||||
'hinclude_default_template' => 'global_hinclude_template',
|
'hinclude_default_template' => 'global_hinclude_template',
|
||||||
),
|
),
|
||||||
@ -71,5 +71,5 @@ $container->loadFromExtension('framework', array(
|
|||||||
'debug' => true,
|
'debug' => true,
|
||||||
'file_cache_dir' => '%kernel.cache_dir%/annotations',
|
'file_cache_dir' => '%kernel.cache_dir%/annotations',
|
||||||
),
|
),
|
||||||
'ide' => 'file%%link%%format'
|
'ide' => 'file%%link%%format',
|
||||||
));
|
));
|
||||||
|
@ -24,7 +24,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$routes->add('foo', new Route(
|
$routes->add('foo', new Route(
|
||||||
' /{_locale}',
|
' /{_locale}',
|
||||||
array(
|
array(
|
||||||
'_locale' => '%locale%'
|
'_locale' => '%locale%',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'_locale' => 'en|es',
|
'_locale' => 'en|es',
|
||||||
|
@ -125,14 +125,14 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
|
|||||||
public static function themeBlockInheritanceProvider()
|
public static function themeBlockInheritanceProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(array('TestBundle:Parent'))
|
array(array('TestBundle:Parent')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function themeInheritanceProvider()
|
public static function themeInheritanceProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(array('TestBundle:Parent'), array('TestBundle:Child'))
|
array(array('TestBundle:Parent'), array('TestBundle:Child')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,6 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertSame('en-US', $translator->getLocale());
|
$this->assertSame('en-US', $translator->getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getCatalogue($locale, $messages)
|
protected function getCatalogue($locale, $messages)
|
||||||
{
|
{
|
||||||
$catalogue = new MessageCatalogue($locale);
|
$catalogue = new MessageCatalogue($locale);
|
||||||
|
@ -309,11 +309,11 @@ class MainConfiguration implements ConfigurationInterface
|
|||||||
'memory' => array(
|
'memory' => array(
|
||||||
'users' => array(
|
'users' => array(
|
||||||
'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'),
|
'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()
|
->disallowNewKeysInSubsequentConfigs()
|
||||||
->isRequired()
|
->isRequired()
|
||||||
@ -370,8 +370,8 @@ class MainConfiguration implements ConfigurationInterface
|
|||||||
'Acme\DemoBundle\Entity\User2' => array(
|
'Acme\DemoBundle\Entity\User2' => array(
|
||||||
'algorithm' => 'sha512',
|
'algorithm' => 'sha512',
|
||||||
'encode_as_base64' => 'true',
|
'encode_as_base64' => 'true',
|
||||||
'iterations'=> 5000
|
'iterations' => 5000,
|
||||||
)
|
),
|
||||||
))
|
))
|
||||||
->requiresAtLeastOneElement()
|
->requiresAtLeastOneElement()
|
||||||
->useAttributeAsKey('class')
|
->useAttributeAsKey('class')
|
||||||
|
@ -61,7 +61,7 @@ class RememberMeFactory implements SecurityFactoryInterface
|
|||||||
|
|
||||||
if (isset($config['token_provider'])) {
|
if (isset($config['token_provider'])) {
|
||||||
$rememberMeServices->addMethodCall('setTokenProvider', array(
|
$rememberMeServices->addMethodCall('setTokenProvider', array(
|
||||||
new Reference($config['token_provider'])
|
new Reference($config['token_provider']),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ class SecurityExtension extends Extension
|
|||||||
->addTag('doctrine.event_listener', array(
|
->addTag('doctrine.event_listener', array(
|
||||||
'connection' => $config['connection'],
|
'connection' => $config['connection'],
|
||||||
'event' => 'postGenerateSchema',
|
'event' => 'postGenerateSchema',
|
||||||
'lazy' => true
|
'lazy' => true,
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -5,5 +5,5 @@ $this->load('container1.php', $container);
|
|||||||
$container->loadFromExtension('security', array(
|
$container->loadFromExtension('security', array(
|
||||||
'acl' => array(
|
'acl' => array(
|
||||||
'provider' => 'foo',
|
'provider' => 'foo',
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
|
@ -16,5 +16,5 @@ $container->loadFromExtension('security', array(
|
|||||||
|
|
||||||
'role_hierarchy' => array(
|
'role_hierarchy' => array(
|
||||||
'FOO' => array('MOO'),
|
'FOO' => array('MOO'),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
|
@ -5,8 +5,8 @@ $container->loadFromExtension('security', array(
|
|||||||
'main' => array(
|
'main' => array(
|
||||||
'form_login' => array(
|
'form_login' => array(
|
||||||
'login_path' => '/login',
|
'login_path' => '/login',
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
'role_hierarchy' => array(
|
'role_hierarchy' => array(
|
||||||
'FOO' => 'BAR',
|
'FOO' => 'BAR',
|
||||||
|
@ -35,9 +35,9 @@ class SecurityExtensionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'pattern' => '/secured_area/.*',
|
'pattern' => '/secured_area/.*',
|
||||||
'form_login' => array(
|
'form_login' => array(
|
||||||
'check_path' => '/some_area/login_check',
|
'check_path' => '/some_area/login_check',
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
$container->compile();
|
$container->compile();
|
||||||
@ -59,8 +59,8 @@ class SecurityExtensionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'firewalls' => array(
|
'firewalls' => array(
|
||||||
'some_firewall' => array(
|
'some_firewall' => array(
|
||||||
'pattern' => '/.*',
|
'pattern' => '/.*',
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
$container->compile();
|
$container->compile();
|
||||||
|
@ -42,7 +42,7 @@ class TwigExtension extends Extension
|
|||||||
if (is_array($value) && isset($value['key'])) {
|
if (is_array($value) && isset($value['key'])) {
|
||||||
$config['globals'][$name] = array(
|
$config['globals'][$name] = array(
|
||||||
'key' => $name,
|
'key' => $name,
|
||||||
'value' => $config['globals'][$name]
|
'value' => $config['globals'][$name],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ $container->loadFromExtension('twig', array(
|
|||||||
'form' => array(
|
'form' => array(
|
||||||
'resources' => array(
|
'resources' => array(
|
||||||
'MyBundle::form.html.twig',
|
'MyBundle::form.html.twig',
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
'globals' => array(
|
'globals' => array(
|
||||||
'foo' => '@bar',
|
'foo' => '@bar',
|
||||||
|
@ -40,7 +40,7 @@ class RenderTokenParserTest extends TestCase
|
|||||||
new \Twig_Node_Expression_Array(array(), 1),
|
new \Twig_Node_Expression_Array(array(), 1),
|
||||||
1,
|
1,
|
||||||
'render'
|
'render'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'{% render "foo", {foo: 1} %}',
|
'{% render "foo", {foo: 1} %}',
|
||||||
@ -52,7 +52,7 @@ class RenderTokenParserTest extends TestCase
|
|||||||
), 1),
|
), 1),
|
||||||
1,
|
1,
|
||||||
'render'
|
'render'
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ class ProfilerController
|
|||||||
$this->profiler->disable();
|
$this->profiler->disable();
|
||||||
|
|
||||||
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
|
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
|
||||||
'about' => $about
|
'about' => $about,
|
||||||
)), 200, array('Content-Type' => 'text/html'));
|
)), 200, array('Content-Type' => 'text/html'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Command;
|
|||||||
|
|
||||||
use Symfony\Bundle\WebProfilerBundle\Command\ExportCommand;
|
use Symfony\Bundle\WebProfilerBundle\Command\ExportCommand;
|
||||||
use Symfony\Component\Console\Tester\CommandTester;
|
use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Symfony\Component\Console\Application;
|
|
||||||
use Symfony\Component\HttpKernel\Profiler\Profile;
|
use Symfony\Component\HttpKernel\Profiler\Profile;
|
||||||
|
|
||||||
class ExportCommandTest extends \PHPUnit_Framework_TestCase
|
class ExportCommandTest extends \PHPUnit_Framework_TestCase
|
||||||
|
@ -13,7 +13,6 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Command;
|
|||||||
|
|
||||||
use Symfony\Bundle\WebProfilerBundle\Command\ImportCommand;
|
use Symfony\Bundle\WebProfilerBundle\Command\ImportCommand;
|
||||||
use Symfony\Component\Console\Tester\CommandTester;
|
use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Symfony\Component\Console\Application;
|
|
||||||
use Symfony\Component\HttpKernel\Profiler\Profile;
|
use Symfony\Component\HttpKernel\Profiler\Profile;
|
||||||
|
|
||||||
class ImportCommandTest extends \PHPUnit_Framework_TestCase
|
class ImportCommandTest extends \PHPUnit_Framework_TestCase
|
||||||
|
@ -50,7 +50,7 @@ class TemplateManagerTest extends TestCase
|
|||||||
$templates = array(
|
$templates = array(
|
||||||
'data_collector.foo' => array('foo','FooBundle:Collector:foo'),
|
'data_collector.foo' => array('foo','FooBundle:Collector:foo'),
|
||||||
'data_collector.bar' => array('bar','FooBundle:Collector:bar'),
|
'data_collector.bar' => array('bar','FooBundle:Collector:bar'),
|
||||||
'data_collector.baz'=>array('baz','FooBundle:Collector:baz')
|
'data_collector.baz' => array('baz','FooBundle:Collector:baz'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
|
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
|
||||||
|
@ -498,7 +498,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||||||
'HTTP_HOST' => 'www.example.com:8080',
|
'HTTP_HOST' => 'www.example.com:8080',
|
||||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||||
'HTTPS' => false,
|
'HTTPS' => false,
|
||||||
'HTTP_REFERER' => 'http://www.example.com:8080/'
|
'HTTP_REFERER' => 'http://www.example.com:8080/',
|
||||||
);
|
);
|
||||||
|
|
||||||
$client = new TestClient();
|
$client = new TestClient();
|
||||||
@ -636,7 +636,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||||||
'HTTP_HOST' => 'testhost',
|
'HTTP_HOST' => 'testhost',
|
||||||
'HTTP_USER_AGENT' => 'testua',
|
'HTTP_USER_AGENT' => 'testua',
|
||||||
'HTTPS' => false,
|
'HTTPS' => false,
|
||||||
'NEW_SERVER_KEY' => 'new-server-key-value'
|
'NEW_SERVER_KEY' => 'new-server-key-value',
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST'));
|
$this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST'));
|
||||||
|
@ -61,7 +61,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$headers = array(
|
$headers = array(
|
||||||
'content-type' => 'text/html; charset=utf-8',
|
'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 = 'content-type: text/html; charset=utf-8'."\n";
|
||||||
|
@ -71,7 +71,6 @@ class ClassMapGenerator
|
|||||||
foreach ($classes as $class) {
|
foreach ($classes as $class) {
|
||||||
$map[$class] = $path;
|
$map[$class] = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $map;
|
return $map;
|
||||||
|
@ -76,7 +76,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
|||||||
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
|
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
|
||||||
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
|
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
|
||||||
'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
|
'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
array(__DIR__.'/Fixtures/beta/NamespaceCollision', array(
|
array(__DIR__.'/Fixtures/beta/NamespaceCollision', array(
|
||||||
'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
|
'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
|
||||||
|
@ -2,4 +2,6 @@
|
|||||||
|
|
||||||
namespace ClassesWithParents;
|
namespace ClassesWithParents;
|
||||||
|
|
||||||
class A extends B {}
|
class A extends B
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -2,4 +2,6 @@
|
|||||||
|
|
||||||
namespace ClassesWithParents;
|
namespace ClassesWithParents;
|
||||||
|
|
||||||
class B implements CInterface {}
|
class B implements CInterface
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -13,5 +13,4 @@ namespace ClassMap;
|
|||||||
|
|
||||||
class SomeClass extends SomeParent implements SomeInterface
|
class SomeClass extends SomeParent implements SomeInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,4 @@ namespace ClassMap;
|
|||||||
|
|
||||||
interface SomeInterface
|
interface SomeInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,4 @@ namespace ClassMap;
|
|||||||
|
|
||||||
abstract class SomeParent
|
abstract class SomeParent
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace {
|
namespace {
|
||||||
class A {}
|
class A
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Alpha {
|
namespace Alpha {
|
||||||
class A {}
|
class A
|
||||||
class B {}
|
{
|
||||||
|
}
|
||||||
|
class B
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Beta {
|
namespace Beta {
|
||||||
class A {}
|
class A
|
||||||
class B {}
|
{
|
||||||
|
}
|
||||||
|
class B
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,9 @@
|
|||||||
|
|
||||||
namespace Foo\Bar;
|
namespace Foo\Bar;
|
||||||
|
|
||||||
class A {}
|
class A
|
||||||
class B {}
|
{
|
||||||
|
}
|
||||||
|
class B
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
trait TD
|
trait TD
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
trait TZ
|
trait TZ
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@ namespace Foo {
|
|||||||
|
|
||||||
class CBar implements IBar
|
class CBar implements IBar
|
||||||
{
|
{
|
||||||
use TBar, TFooBar;
|
use TBar;
|
||||||
|
use TFooBar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,6 @@ class UniversalClassLoader
|
|||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// PEAR-like class name
|
// PEAR-like class name
|
||||||
$normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
$normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
||||||
|
@ -123,5 +123,4 @@ class ConfigCache
|
|||||||
{
|
{
|
||||||
return $this->file.'.meta';
|
return $this->file.'.meta';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,5 +39,4 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
|
|||||||
{
|
{
|
||||||
return new BooleanNode($this->name, $this->parent);
|
return new BooleanNode($this->name, $this->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -243,5 +243,4 @@ class NodeBuilder implements NodeParentInterface
|
|||||||
|
|
||||||
return $class;
|
return $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -343,5 +343,4 @@ abstract class NodeDefinition implements NodeParentInterface
|
|||||||
* @throws InvalidDefinitionException When the definition is invalid
|
* @throws InvalidDefinitionException When the definition is invalid
|
||||||
*/
|
*/
|
||||||
abstract protected function createNode();
|
abstract protected function createNode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,5 +64,4 @@ class VariableNodeDefinition extends NodeDefinition
|
|||||||
|
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ class ReferenceDumper
|
|||||||
if ($info = $node->getInfo()) {
|
if ($info = $node->getInfo()) {
|
||||||
$this->writeLine('');
|
$this->writeLine('');
|
||||||
// indenting multi-line info
|
// 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);
|
$this->writeLine('# '.$info, $depth * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,5 +49,4 @@ interface LoaderInterface
|
|||||||
* @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
|
* @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
|
||||||
*/
|
*/
|
||||||
public function setResolver(LoaderResolverInterface $resolver);
|
public function setResolver(LoaderResolverInterface $resolver);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
array(
|
array(
|
||||||
array('foo-bar' => null, 'foo_bar' => 'foo'),
|
array('foo-bar' => null, 'foo_bar' => 'foo'),
|
||||||
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('defaultValue', array(array())),
|
||||||
array('addDefaultChildrenIfNoneSet', array()),
|
array('addDefaultChildrenIfNoneSet', array()),
|
||||||
array('requiresAtLeastOneElement', array()),
|
array('requiresAtLeastOneElement', array()),
|
||||||
array('useAttributeAsKey', array('foo'))
|
array('useAttributeAsKey', array('foo')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
|||||||
|
|
||||||
class ExprBuilderTest extends \PHPUnit_Framework_TestCase
|
class ExprBuilderTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testAlwaysExpression()
|
public function testAlwaysExpression()
|
||||||
{
|
{
|
||||||
$test = $this->getTestBuilder()
|
$test = $this->getTestBuilder()
|
||||||
@ -59,7 +58,6 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
->then($this->returnClosure('new_value'))
|
->then($this->returnClosure('new_value'))
|
||||||
->end();
|
->end();
|
||||||
$this->assertFinalizedValueIs(45, $test, array('key' => 45));
|
$this->assertFinalizedValueIs(45, $test, array('key' => 45));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIfNullExpression()
|
public function testIfNullExpression()
|
||||||
|
@ -34,7 +34,7 @@ class FloatNodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
// Integer are accepted too, they will be cast
|
// Integer are accepted too, they will be cast
|
||||||
array(17),
|
array(17),
|
||||||
array(-10),
|
array(-10),
|
||||||
array(0)
|
array(0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,14 +115,14 @@ class MergeTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$a = array(
|
$a = array(
|
||||||
'test' => array(
|
'test' => array(
|
||||||
'a' => array('value' => 'foo')
|
'a' => array('value' => 'foo'),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$b = array(
|
$b = array(
|
||||||
'test' => array(
|
'test' => array(
|
||||||
'b' => array('value' => 'foo')
|
'b' => array('value' => 'foo'),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$tree->merge($a, $b);
|
$tree->merge($a, $b);
|
||||||
@ -157,13 +157,13 @@ class MergeTest extends \PHPUnit_Framework_TestCase
|
|||||||
$b = array(
|
$b = array(
|
||||||
'no_deep_merging' => array(
|
'no_deep_merging' => array(
|
||||||
'c' => 'd',
|
'c' => 'd',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(array(
|
$this->assertEquals(array(
|
||||||
'no_deep_merging' => array(
|
'no_deep_merging' => array(
|
||||||
'c' => 'd',
|
'c' => 'd',
|
||||||
)
|
),
|
||||||
), $tree->merge($a, $b));
|
), $tree->merge($a, $b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,8 +176,8 @@ class NormalizationTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$denormalized = array(
|
$denormalized = array(
|
||||||
'thing' => array(
|
'thing' => array(
|
||||||
array('foo', 'bar'), array('baz', 'qux')
|
array('foo', 'bar'), array('baz', 'qux'),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, array());
|
$this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, array());
|
||||||
|
@ -28,7 +28,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||||||
'blue' => 34,
|
'blue' => 34,
|
||||||
'magenta' => 35,
|
'magenta' => 35,
|
||||||
'cyan' => 36,
|
'cyan' => 36,
|
||||||
'white' => 37
|
'white' => 37,
|
||||||
);
|
);
|
||||||
private static $availableBackgroundColors = array(
|
private static $availableBackgroundColors = array(
|
||||||
'black' => 40,
|
'black' => 40,
|
||||||
@ -38,14 +38,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||||||
'blue' => 44,
|
'blue' => 44,
|
||||||
'magenta' => 45,
|
'magenta' => 45,
|
||||||
'cyan' => 46,
|
'cyan' => 46,
|
||||||
'white' => 47
|
'white' => 47,
|
||||||
);
|
);
|
||||||
private static $availableOptions = array(
|
private static $availableOptions = array(
|
||||||
'bold' => 1,
|
'bold' => 1,
|
||||||
'underscore' => 4,
|
'underscore' => 4,
|
||||||
'blink' => 5,
|
'blink' => 5,
|
||||||
'reverse' => 7,
|
'reverse' => 7,
|
||||||
'conceal' => 8
|
'conceal' => 8,
|
||||||
);
|
);
|
||||||
|
|
||||||
private $foreground;
|
private $foreground;
|
||||||
|
@ -146,7 +146,8 @@ class DialogHelper extends Helper
|
|||||||
|
|
||||||
// Pop the last character off the end of our string
|
// Pop the last character off the end of our string
|
||||||
$ret = substr($ret, 0, $i);
|
$ret = substr($ret, 0, $i);
|
||||||
} elseif ("\033" === $c) { // Did we read an escape sequence?
|
} elseif ("\033" === $c) {
|
||||||
|
// Did we read an escape sequence?
|
||||||
$c .= fread($inputStream, 2);
|
$c .= fread($inputStream, 2);
|
||||||
|
|
||||||
// A = Up Arrow. B = Down Arrow
|
// A = Up Arrow. B = Down Arrow
|
||||||
|
@ -240,7 +240,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
|
|||||||
return array(
|
return array(
|
||||||
array('f', 'Command "f" is not defined.'),
|
array('f', 'Command "f" is not defined.'),
|
||||||
array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'),
|
array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'),
|
||||||
array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1).')
|
array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1).'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('foo:baR'),
|
array('foo:baR'),
|
||||||
array('foO:bar')
|
array('foO:bar'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(''),
|
array(''),
|
||||||
array('foo:')
|
array('foo:'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ EOF;
|
|||||||
|
|
||||||
public function testExecuteListsCommandsWithNamespaceArgument()
|
public function testExecuteListsCommandsWithNamespaceArgument()
|
||||||
{
|
{
|
||||||
|
|
||||||
require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
|
require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
$application->add(new \FooCommand());
|
$application->add(new \FooCommand());
|
||||||
|
@ -57,92 +57,92 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('cli.php', '--foo'),
|
array('cli.php', '--foo'),
|
||||||
array(new InputOption('foo')),
|
array(new InputOption('foo')),
|
||||||
array('foo' => true),
|
array('foo' => true),
|
||||||
'->parse() parses long options without a value'
|
'->parse() parses long options without a value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '--foo=bar'),
|
array('cli.php', '--foo=bar'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses long options with a required value (with a = separator)'
|
'->parse() parses long options with a required value (with a = separator)',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '--foo', 'bar'),
|
array('cli.php', '--foo', 'bar'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses long options with a required value (with a space separator)'
|
'->parse() parses long options with a required value (with a space separator)',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f'),
|
array('cli.php', '-f'),
|
||||||
array(new InputOption('foo', 'f')),
|
array(new InputOption('foo', 'f')),
|
||||||
array('foo' => true),
|
array('foo' => true),
|
||||||
'->parse() parses short options without a value'
|
'->parse() parses short options without a value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-fbar'),
|
array('cli.php', '-fbar'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses short options with a required value (with no separator)'
|
'->parse() parses short options with a required value (with no separator)',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f', 'bar'),
|
array('cli.php', '-f', 'bar'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses short options with a required value (with a space separator)'
|
'->parse() parses short options with a required value (with a space separator)',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f', ''),
|
array('cli.php', '-f', ''),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
|
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
|
||||||
array('foo' => ''),
|
array('foo' => ''),
|
||||||
'->parse() parses short options with an optional empty value'
|
'->parse() parses short options with an optional empty value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f', '', 'foo'),
|
array('cli.php', '-f', '', 'foo'),
|
||||||
array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
|
array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
|
||||||
array('foo' => ''),
|
array('foo' => ''),
|
||||||
'->parse() parses short options with an optional empty value followed by an argument'
|
'->parse() parses short options with an optional empty value followed by an argument',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f', '', '-b'),
|
array('cli.php', '-f', '', '-b'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
|
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
|
||||||
array('foo' => '', 'bar' => true),
|
array('foo' => '', 'bar' => true),
|
||||||
'->parse() parses short options with an optional empty value followed by an option'
|
'->parse() parses short options with an optional empty value followed by an option',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f', '-b', 'foo'),
|
array('cli.php', '-f', '-b', 'foo'),
|
||||||
array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
|
array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
|
||||||
array('foo' => null, 'bar' => true),
|
array('foo' => null, 'bar' => true),
|
||||||
'->parse() parses short options with an optional value which is not present'
|
'->parse() parses short options with an optional value which is not present',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-fb'),
|
array('cli.php', '-fb'),
|
||||||
array(new InputOption('foo', 'f'), new InputOption('bar', 'b')),
|
array(new InputOption('foo', 'f'), new InputOption('bar', 'b')),
|
||||||
array('foo' => true, 'bar' => true),
|
array('foo' => true, 'bar' => true),
|
||||||
'->parse() parses short options when they are aggregated as a single one'
|
'->parse() parses short options when they are aggregated as a single one',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-fb', 'bar'),
|
array('cli.php', '-fb', 'bar'),
|
||||||
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)),
|
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)),
|
||||||
array('foo' => true, 'bar' => 'bar'),
|
array('foo' => true, 'bar' => 'bar'),
|
||||||
'->parse() parses short options when they are aggregated as a single one and the last one has a required value'
|
'->parse() parses short options when they are aggregated as a single one and the last one has a required value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-fb', 'bar'),
|
array('cli.php', '-fb', 'bar'),
|
||||||
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
|
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
|
||||||
array('foo' => true, 'bar' => 'bar'),
|
array('foo' => true, 'bar' => 'bar'),
|
||||||
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value'
|
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-fbbar'),
|
array('cli.php', '-fbbar'),
|
||||||
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
|
array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
|
||||||
array('foo' => true, 'bar' => 'bar'),
|
array('foo' => true, 'bar' => 'bar'),
|
||||||
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator'
|
'->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-fbbar'),
|
array('cli.php', '-fbbar'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
|
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
|
||||||
array('foo' => 'bbar', 'bar' => null),
|
array('foo' => 'bbar', 'bar' => null),
|
||||||
'->parse() parses short options when they are aggregated as a single one and one of them takes a value'
|
'->parse() parses short options when they are aggregated as a single one and one of them takes a value',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,43 +163,43 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
|
|||||||
array(
|
array(
|
||||||
array('cli.php', '--foo'),
|
array('cli.php', '--foo'),
|
||||||
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
|
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
|
||||||
'The "--foo" option requires a value.'
|
'The "--foo" option requires a value.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f'),
|
array('cli.php', '-f'),
|
||||||
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
|
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
|
||||||
'The "--foo" option requires a value.'
|
'The "--foo" option requires a value.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-ffoo'),
|
array('cli.php', '-ffoo'),
|
||||||
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
|
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
|
||||||
'The "-o" option does not exist.'
|
'The "-o" option does not exist.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '--foo=bar'),
|
array('cli.php', '--foo=bar'),
|
||||||
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
|
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
|
||||||
'The "--foo" option does not accept a value.'
|
'The "--foo" option does not accept a value.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', 'foo', 'bar'),
|
array('cli.php', 'foo', 'bar'),
|
||||||
new InputDefinition(),
|
new InputDefinition(),
|
||||||
'Too many arguments.'
|
'Too many arguments.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '--foo'),
|
array('cli.php', '--foo'),
|
||||||
new InputDefinition(),
|
new InputDefinition(),
|
||||||
'The "--foo" option does not exist.'
|
'The "--foo" option does not exist.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-f'),
|
array('cli.php', '-f'),
|
||||||
new InputDefinition(),
|
new InputDefinition(),
|
||||||
'The "-f" option does not exist.'
|
'The "-f" option does not exist.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('cli.php', '-1'),
|
array('cli.php', '-1'),
|
||||||
new InputDefinition(array(new InputArgument('number'))),
|
new InputDefinition(array(new InputArgument('number'))),
|
||||||
'The "-1" option does not exist.'
|
'The "-1" option does not exist.',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,26 +62,26 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('--foo' => 'bar'),
|
array('--foo' => 'bar'),
|
||||||
array(new InputOption('foo')),
|
array(new InputOption('foo')),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses long options'
|
'->parse() parses long options',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('--foo' => 'bar'),
|
array('--foo' => 'bar'),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
|
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses long options with a default value'
|
'->parse() parses long options with a default value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('--foo' => null),
|
array('--foo' => null),
|
||||||
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
|
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
|
||||||
array('foo' => 'default'),
|
array('foo' => 'default'),
|
||||||
'->parse() parses long options with a default value'
|
'->parse() parses long options with a default value',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('-f' => 'bar'),
|
array('-f' => 'bar'),
|
||||||
array(new InputOption('foo', 'f')),
|
array(new InputOption('foo', 'f')),
|
||||||
array('foo' => 'bar'),
|
array('foo' => 'bar'),
|
||||||
'->parse() parses short options'
|
'->parse() parses short options',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,23 +101,23 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
|
|||||||
array(
|
array(
|
||||||
array('foo' => 'foo'),
|
array('foo' => 'foo'),
|
||||||
new InputDefinition(array(new InputArgument('name'))),
|
new InputDefinition(array(new InputArgument('name'))),
|
||||||
'The "foo" argument does not exist.'
|
'The "foo" argument does not exist.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('--foo' => null),
|
array('--foo' => null),
|
||||||
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
|
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
|
||||||
'The "--foo" option requires a value.'
|
'The "--foo" option requires a value.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('--foo' => 'foo'),
|
array('--foo' => 'foo'),
|
||||||
new InputDefinition(),
|
new InputDefinition(),
|
||||||
'The "--foo" option does not exist.'
|
'The "--foo" option does not exist.',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array('-o' => 'foo'),
|
array('-o' => 'foo'),
|
||||||
new InputDefinition(),
|
new InputDefinition(),
|
||||||
'The "-o" option does not exist.'
|
'The "-o" option does not exist.',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class InputArgumentTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('ANOTHER_ONE'),
|
array('ANOTHER_ONE'),
|
||||||
array(-1)
|
array(-1),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class InputOptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('ANOTHER_ONE'),
|
array('ANOTHER_ONE'),
|
||||||
array(-1)
|
array(-1),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class Parser implements ParserInterface
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
$first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1,
|
$first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1,
|
||||||
isset($split[1]) && $split[1] ? $int($split[1]) : 0
|
isset($split[1]) && $split[1] ? $int($split[1]) : 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class ClassParser implements ParserInterface
|
|||||||
// 4 => string 'ab6bd_field' (length=11)
|
// 4 => string 'ab6bd_field' (length=11)
|
||||||
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?\.([\w-]+)$/i', trim($source), $matches)) {
|
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?\.([\w-]+)$/i', trim($source), $matches)) {
|
||||||
return array(
|
return array(
|
||||||
new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4]))
|
new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class HashParser implements ParserInterface
|
|||||||
// 4 => string 'ab6bd_field' (length=11)
|
// 4 => string 'ab6bd_field' (length=11)
|
||||||
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?#([\w-]+)$/i', trim($source), $matches)) {
|
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?#([\w-]+)$/i', trim($source), $matches)) {
|
||||||
return array(
|
return array(
|
||||||
new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4]))
|
new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,6 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($exception->getMessage(), $flattened->getMessage(), 'The message is copied from the original exception.');
|
$this->assertEquals($exception->getMessage(), $flattened->getMessage(), 'The message is copied from the original exception.');
|
||||||
$this->assertEquals($exception->getCode(), $flattened->getCode(), 'The code is copied from the original exception.');
|
$this->assertEquals($exception->getCode(), $flattened->getCode(), 'The code is copied from the original exception.');
|
||||||
$this->assertInstanceOf($flattened->getClass(), $exception, 'The class is set to the class of the original exception');
|
$this->assertInstanceOf($flattened->getClass(), $exception, 'The class is set to the class of the original exception');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,9 +163,9 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'class' => 'Exception',
|
'class' => 'Exception',
|
||||||
'trace' => array(array(
|
'trace' => array(array(
|
||||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123,
|
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123,
|
||||||
'args' => array()
|
'args' => array(),
|
||||||
)),
|
)),
|
||||||
)
|
),
|
||||||
), $flattened->toArray());
|
), $flattened->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +201,7 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'line' => 123,
|
'line' => 123,
|
||||||
'function' => 'test',
|
'function' => 'test',
|
||||||
'args' => array(
|
'args' => array(
|
||||||
unserialize('O:14:"BogusTestClass":0:{}')
|
unserialize('O:14:"BogusTestClass":0:{}'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -224,12 +223,12 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
'file' => __FILE__, 'line' => 123,
|
'file' => __FILE__, 'line' => 123,
|
||||||
'args' => array(
|
'args' => array(
|
||||||
array(
|
array(
|
||||||
'incomplete-object', 'BogusTestClass'
|
'incomplete-object', 'BogusTestClass',
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
),
|
),
|
||||||
)
|
|
||||||
), $flattened->toArray());
|
), $flattened->toArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,5 +29,4 @@ interface IntrospectableContainerInterface extends ContainerInterface
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function initialized($id);
|
public function initialized($id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user