This commit is contained in:
Fabien Potencier 2011-06-08 19:56:59 +02:00
parent 4c01d64b6b
commit 17cd08dc6c
202 changed files with 1698 additions and 1683 deletions

View File

@ -25,6 +25,7 @@ class Hour1200Transformer extends HourTransformer
{
$hourOfDay = $dateTime->format('g');
$hourOfDay = ('12' == $hourOfDay) ? '0' : $hourOfDay;
return $this->padLeft($hourOfDay, $length);
}

View File

@ -25,6 +25,7 @@ class Hour2401Transformer extends HourTransformer
{
$hourOfDay = $dateTime->format('G');
$hourOfDay = ('0' == $hourOfDay) ? '24' : $hourOfDay;
return $this->padLeft($hourOfDay, $length);
}

View File

@ -303,6 +303,7 @@ class StubNumberFormatter
// The original NumberFormatter does not support this format type
if ($type == self::TYPE_CURRENCY) {
trigger_error(__METHOD__ . '(): Unsupported format type ' . $type, \E_USER_WARNING);
return false;
}
@ -439,6 +440,7 @@ class StubNumberFormatter
{
if ($type == self::TYPE_DEFAULT || $type == self::TYPE_CURRENCY) {
trigger_error(__METHOD__ . '(): Unsupported format type ' . $type, \E_USER_WARNING);
return false;
}
@ -593,6 +595,7 @@ class StubNumberFormatter
private function getCurrencySymbol($currency)
{
$currencies = StubLocale::getCurrenciesData($this->locale);
return $currencies[$currency]['symbol'];
}
@ -605,6 +608,7 @@ class StubNumberFormatter
private function getCurrencyFractionDigits($currency)
{
$currencies = StubLocale::getCurrenciesData($this->locale);
return $currencies[$currency]['fractionDigits'];
}
@ -617,6 +621,7 @@ class StubNumberFormatter
private function getCurrencyRoundingIncrement($currency)
{
$currencies = StubLocale::getCurrenciesData($this->locale);
return $currencies[$currency]['roundingIncrement'];
}

View File

@ -23,4 +23,4 @@ class CompositeIdentEntity
$this->id2 = $id2;
$this->name = $name;
}
}
}

View File

@ -19,4 +19,4 @@ class SingleIdentEntity
$this->id = $id;
$this->name = $name;
}
}
}

View File

@ -106,4 +106,4 @@ class EntityChoiceListTest extends DoctrineOrmTestCase
'group2' => array(2 => 'Bar')
), $choiceList->getChoices());
}
}
}

View File

@ -103,4 +103,4 @@ abstract class AbstractDriverTest extends \PHPUnit_Framework_TestCase
return $ref->invokeArgs($obj, $args);
}
}
}

View File

@ -27,4 +27,4 @@ class XmlDriverTest extends AbstractDriverTest
return $driver;
}
}
}

View File

@ -27,4 +27,4 @@ class YamlDriverTest extends AbstractDriverTest
return $driver;
}
}
}

View File

@ -22,8 +22,8 @@ if (!class_exists('Twig_Environment')) {
{
// strip away bundle name
$parts = explode(':', $name);
return parent::findTemplate(end($parts));
}
}
}
}

View File

@ -32,4 +32,4 @@ class StubTranslator implements TranslatorInterface
public function getLocale()
{
}
}
}

View File

@ -3,4 +3,4 @@
{# TODO find a smarter way to render the parent type #}
<input type="text" id="{{ id }}" value="{{ value }}" />
</div>
{% endblock _text_id_widget %}
{% endblock _text_id_widget %}

View File

@ -73,4 +73,4 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expected, $response->__toString(), '->__toString() returns the headers and the content as a string');
}
}
}

View File

@ -5,4 +5,4 @@ namespace Apc\Namespaced;
class Baz
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class ApcPrefixCollision_A_Bar
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class ApcPrefixCollision_A_Foo
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace Apc\NamespaceCollision\A;
class Bar
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace Apc\NamespaceCollision\A;
class Foo
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class ApcPrefixCollision_A_B_Bar
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class ApcPrefixCollision_A_B_Foo
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace Apc\NamespaceCollision\A\B;
class Bar
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace Apc\NamespaceCollision\A\B;
class Foo
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace Namespaced;
class Baz
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace NamespaceCollision\A;
class Bar
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace NamespaceCollision\A;
class Foo
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class PrefixCollision_A_Bar
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class PrefixCollision_A_Foo
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace NamespaceCollision\A\B;
class Bar
{
public static $loaded = true;
}
}

View File

@ -5,4 +5,4 @@ namespace NamespaceCollision\A\B;
class Foo
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class PrefixCollision_A_B_Bar
{
public static $loaded = true;
}
}

View File

@ -3,4 +3,4 @@
class PrefixCollision_A_B_Foo
{
public static $loaded = true;
}
}

View File

@ -39,4 +39,4 @@ class ArrayNodeDefinitionTest extends \PHPUnit_Framework_TestCase
return $reflection->getValue($object);
}
}
}

View File

@ -80,4 +80,4 @@ class NodeBuilderTest extends \PHPUnit_Framework_TestCase
class SomeNodeDefinition extends BaseVariableNodeDefinition
{
}
}

View File

@ -89,4 +89,4 @@ class TreeBuilderTest extends \PHPUnit_Framework_TestCase
->end()
->end();
}
}
}

View File

@ -71,4 +71,4 @@ class FinalizationTest extends \PHPUnit_Framework_TestCase
return $processor->process($tree, $configs);
}
}
}

View File

@ -192,4 +192,4 @@ class MergeTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('append_elements' => array('a', 'b', 'c', 'd')), $tree->merge($a, $b));
}
}
}

View File

@ -141,4 +141,4 @@ class NormalizerTest extends \PHPUnit_Framework_TestCase
{
self::assertSame($normalized, $tree->normalize($denormalized));
}
}
}

View File

@ -57,4 +57,4 @@ class ScalarNodeTest extends \PHPUnit_Framework_TestCase
array(new \stdClass()),
);
}
}
}

View File

@ -9,4 +9,4 @@ class BarNodeDefinition extends NodeDefinition
protected function createNode()
{
}
}
}

View File

@ -22,4 +22,4 @@ class NodeBuilder extends BaseNodeBuilder
return parent::getNodeClass($type);
}
}
}
}

View File

@ -6,4 +6,4 @@ use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVa
class VariableNodeDefinition extends BaseVariableNodeDefinition
{
}
}

View File

@ -22,4 +22,4 @@ class Foo3Command extends Command
throw new \Exception("Second exception", 0, $e);
}
}
}
}

View File

@ -69,4 +69,4 @@ class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase
$compiler->compile($container);
}
}
}

View File

@ -67,4 +67,4 @@ class CheckDefinitionValidityPassTest extends \PHPUnit_Framework_TestCase
$pass = new CheckDefinitionValidityPass();
$pass->process($container);
}
}
}

View File

@ -68,4 +68,4 @@ class CheckExceptionOnInvalidReferenceBehaviorPassTest extends \PHPUnit_Framewor
$pass = new CheckExceptionOnInvalidReferenceBehaviorPass();
$pass->process($container);
}
}
}

View File

@ -95,4 +95,4 @@ class CheckReferenceValidityPassTest extends \PHPUnit_Framework_TestCase
$pass = new CheckReferenceValidityPass();
$pass->process($container);
}
}
}

View File

@ -131,4 +131,4 @@ class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase
$repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()));
$repeatedPass->process($container);
}
}
}

View File

@ -108,4 +108,4 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($container->hasDefinition('b'));
$this->assertFalse($container->hasDefinition('c'), 'Service C was not inlined.');
}
}
}

View File

@ -86,4 +86,4 @@ class RemoveUnusedDefinitionsPassTest extends \PHPUnit_Framework_TestCase
$repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new RemoveUnusedDefinitionsPass()));
$repeatedPass->process($container);
}
}
}

View File

@ -53,4 +53,4 @@ class ResolveReferencesToAliasesPassTest extends \PHPUnit_Framework_TestCase
$pass = new ResolveReferencesToAliasesPass();
$pass->process($container);
}
}
}

View File

@ -69,4 +69,4 @@ class DefinitionDecoratorTest extends \PHPUnit_Framework_TestCase
$this->assertSame($def, $def->replaceArgument(0, 'foo'));
$this->assertEquals(array('index_0' => 'foo'), $def->getArguments());
}
}
}

View File

@ -9,4 +9,4 @@ $container->
addArgument(new Definition('BarClass', array(new Definition('BazClass'))))
;
return $container;
return $container;

View File

@ -10,4 +10,4 @@ $container->
addTag('foo"bar\\bar', array('foo' => 'foo"barřž€'))
;
return $container;
return $container;

View File

@ -31,4 +31,4 @@ class BarClassFactory
{
return new BarClass();
}
}
}

View File

@ -44,4 +44,4 @@ $phar->addFromString('schema/project-1.0.xsd', <<<EOT
</xsd:schema>
EOT
);
$phar->setStub('<?php require_once "phar://ProjectWithXsdExtensionInPhar.phar/ProjectWithXsdExtensionInPhar.php"; __HALT_COMPILER(); ?>');
$phar->setStub('<?php require_once "phar://ProjectWithXsdExtensionInPhar.phar/ProjectWithXsdExtensionInPhar.php"; __HALT_COMPILER(); ?>');

View File

@ -8,4 +8,4 @@
<project:bar />
</container>
</container>

View File

@ -8,4 +8,4 @@
<project:bar bar="foo" />
</container>
</container>

View File

@ -2,4 +2,4 @@ services:
foo_service:
class: FooClass
# tags is not an array
tags: string
tags: string

View File

@ -3,4 +3,4 @@ services:
class: FooClass
tags:
# tag is missing the name key
foo_tag: { foo: bar }
foo_tag: { foo: bar }

View File

@ -8,4 +8,4 @@ parameters:
bar: foo
foo_bar: @foo_bar
MixedCase:
MixedCaseKey: value
MixedCaseKey: value

View File

@ -296,7 +296,7 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
$loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension1'));
$loader1->load('services.xml');
$services = $container->getDefinitions();
$this->assertEquals(2, count($services), '->load() attributes unique ids to anonymous services');
$this->assertEquals(2, count($services), '->load() attributes unique ids to anonymous services');
$loader2 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension2'));
$loader2->load('services.xml');
$services = $container->getDefinitions();

View File

@ -45,4 +45,4 @@ class ConcreteExtension extends AbstractExtension
protected function loadTypeGuesser()
{
}
}
}

View File

@ -50,4 +50,4 @@ class MyTestType extends AbstractType {}
class MyTestForm extends AbstractType {}
class MyTestFormType extends AbstractType {}
class MyTestFormType extends AbstractType {}

View File

@ -82,4 +82,4 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$this->mapper->mapDataToForm(null, $form);
}
}
}

View File

@ -19,4 +19,4 @@ class DateTimeTestCase extends LocalizedTestCase
{
self::assertEquals($expected->format('c'), $actual->format('c'));
}
}
}

View File

@ -21,4 +21,4 @@ class LocalizedTestCase extends \PHPUnit_Framework_TestCase
$this->markTestSkipped('The "intl" extension is not available');
}
}
}
}

View File

@ -164,4 +164,4 @@ class FixFileUploadListenerTest extends \PHPUnit_Framework_TestCase
return $file;
}
}
}

View File

@ -51,4 +51,4 @@ class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('ftp://www.symfony.com', $event->getData());
}
}
}

View File

@ -254,4 +254,4 @@ class ResizeFormListenerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array(), $event->getData());
}
}
}

View File

@ -39,4 +39,4 @@ class TrimListenerTest extends \PHPUnit_Framework_TestCase
$this->assertSame(1234, $event->getData());
}
}
}

View File

@ -172,9 +172,9 @@ class ChoiceTypeTest extends TypeTestCase
'expanded' => true,
'choices' => $this->choices,
));
$form->bind(false);
$this->assertEmpty($form->getExtraData());
$this->assertNull($form->getData());
}

View File

@ -160,4 +160,4 @@ class DateTimeTypeTest extends LocalizedTestCase
$this->assertEquals($dateTime->format('Y-m-d H:i:s'), $form->getData());
}
}
}

View File

@ -136,6 +136,7 @@ class FormTypeTest extends TypeTestCase
$builder->get('referenceCopy')->appendClientTransformer(new CallbackTransformer(
function () {},
function ($value) { // reverseTransform
return 'foobar';
}
));
@ -162,6 +163,7 @@ class FormTypeTest extends TypeTestCase
$builder->get('referenceCopy')->appendClientTransformer(new CallbackTransformer(
function () {},
function ($value) use ($ref2) { // reverseTransform
return $ref2;
}
));

View File

@ -26,4 +26,4 @@ class IntegerTypeTest extends LocalizedTestCase
$this->assertSame(1, $form->getData());
$this->assertSame('1', $form->getClientData());
}
}
}

View File

@ -23,4 +23,4 @@ abstract class LocalizedTestCase extends TypeTestCase
$this->markTestSkipped('The "intl" extension is not available');
}
}
}
}

View File

@ -61,4 +61,4 @@ class RepeatedTypeTest extends TypeTestCase
$this->assertEquals($input, $this->form->getClientData());
$this->assertEquals('foo', $this->form->getData());
}
}
}

View File

@ -396,4 +396,4 @@ class TimeTypeTest extends LocalizedTestCase
$this->assertTrue($form->isPartiallyFilled());
}
}
}

View File

@ -62,4 +62,4 @@ class UrlTypeTest extends LocalizedTestCase
$this->assertSame('www.domain.com', $form->getData());
$this->assertSame('www.domain.com', $form->getClientData());
}
}
}

View File

@ -47,4 +47,4 @@ class DefaultCsrfProviderTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($this->provider->isCsrfTokenValid('foo', $token));
}
}
}

View File

@ -70,4 +70,4 @@ class SessionCsrfProviderTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($this->provider->isCsrfTokenValid('foo', $token));
}
}
}

View File

@ -607,4 +607,4 @@ class DelegatingValidatorTest extends \PHPUnit_Framework_TestCase
$this->validator->validate($form);
}
}
}

View File

@ -48,4 +48,4 @@ class Author
private function setPrivateSetter($data)
{
}
}
}

View File

@ -32,4 +32,4 @@ class FixedDataTransformer implements DataTransformerInterface
return $result;
}
}
}

View File

@ -46,4 +46,4 @@ class FooType extends AbstractType
{
return null;
}
}
}

View File

@ -23,4 +23,4 @@ class FooTypeBarExtension extends AbstractTypeExtension
{
return 'foo';
}
}
}

View File

@ -16,4 +16,4 @@ class FooTypeBazExtension extends AbstractTypeExtension
{
return 'foo';
}
}
}

View File

@ -15,4 +15,4 @@ class Magician
{
return isset($this->$property) ? $this->$property : null;
}
}
}

View File

@ -60,4 +60,4 @@ class TestExtension implements FormExtensionInterface
{
return $this->guesser;
}
}
}

View File

@ -147,4 +147,4 @@ class FormBuilderTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
}
}
}

View File

@ -4,4 +4,4 @@ namespace Symfony\Tests\Component\Form;
interface FormInterface extends \Iterator, \Symfony\Component\Form\FormInterface
{
}
}

View File

@ -1029,4 +1029,4 @@ class FormTest extends \PHPUnit_Framework_TestCase
{
return $this->getMock('Symfony\Component\Form\FormValidatorInterface');
}
}
}

View File

@ -33,4 +33,4 @@ class GuessTest extends \PHPUnit_Framework_TestCase
{
new TestGuess(5);
}
}
}

View File

@ -399,4 +399,4 @@ class PropertyPathTest extends \PHPUnit_Framework_TestCase
new PropertyPath(null);
}
}
}

View File

@ -50,4 +50,4 @@ class FormUtilTest extends \PHPUnit_Framework_TestCase
$this->assertSame($out, FormUtil::toArrayKeys($in));
}
}
}

View File

@ -137,15 +137,15 @@ class CookieTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($cookie->isCleared(), '->isCleared() returns true if the cookie has expired');
}
public function testToString()
{
$cookie = new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true);
$this->assertEquals('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly', $cookie->__toString(), '->__toString() returns string representation of the cookie');
$cookie = new Cookie('foo', null, 1, '/', '.myfoodomain.com');
$this->assertEquals('foo=deleted; expires=' . gmdate("D, d-M-Y H:i:s T", time()-31536001) . '; path=/; domain=.myfoodomain.com; httponly', $cookie->__toString(), '->__toString() returns string representation of a cleared cookie if value is NULL');
}
}

View File

@ -184,4 +184,4 @@ class FileTest extends \PHPUnit_Framework_TestCase
return $guesser;
}
}
}

View File

@ -79,7 +79,7 @@ class UploadedFileTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('original.gif', $file->getOriginalName());
}
public function testGetOriginalNameSanitizeFilename()
{
$file = new UploadedFile(
@ -91,5 +91,5 @@ class UploadedFileTest extends \PHPUnit_Framework_TestCase
);
$this->assertEquals('original.gif', $file->getOriginalName());
}
}
}

View File

@ -162,4 +162,4 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(123, $bag->getInt('digits'), '->getInt() gets a value of parameter as integer');
$this->assertEquals(0, $bag->getInt('unknown'), '->getInt() returns zero if a parameter is not defined');
}
}
}

View File

@ -462,11 +462,11 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$request->setMethod('POST');
$request->request->set('_method', 'purge');
$this->assertEquals('PURGE', $request->getMethod(), '->getMethod() returns the method from _method if defined and POST');
$request->setMethod('POST');
$request->server->set('X-HTTP-METHOD-OVERRIDE', 'delete');
$this->assertEquals('DELETE', $request->getMethod(), '->getMethod() returns the method from X-HTTP-Method-Override even though _method is set if defined and POST');
$request = new Request();
$request->setMethod('POST');
$request->server->set('X-HTTP-METHOD-OVERRIDE', 'delete');

Some files were not shown because too many files have changed in this diff Show More