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

@ -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

@ -42,6 +42,7 @@ class TestHttpKernel extends HttpKernel implements ControllerResolverInterface
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = false)
{
$this->catch = $catch;
return parent::handle($request, $type, $catch);
}

View File

@ -211,6 +211,7 @@ class KernelTest extends \PHPUnit_Framework_TestCase
{
if (!function_exists('token_get_all')) {
$this->markTestSkipped('The function token_get_all() is not available.');
return;
}
$source = <<<EOF

View File

@ -282,6 +282,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
public function formatErrorProvider()
{
/* errors */
return array(
array('y-M-d', '0', false, 1, 'datefmt_format: takes either an array or an integer timestamp value : U_ILLEGAL_ARGUMENT_ERROR'),
array('y-M-d', 'foobar', false, 1, 'datefmt_format: takes either an array or an integer timestamp value : U_ILLEGAL_ARGUMENT_ERROR'),

View File

@ -981,6 +981,7 @@ class StubNumberFormatterTest extends LocaleTestCase
$formatter = new \NumberFormatter('en', \NumberFormatter::CURRENCY);
$formatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, 'SFD');
return $formatter;
}
}

View File

@ -180,6 +180,7 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase
protected function getAcl($strategy)
{
static $id = 1;
return new Acl($id++, new ObjectIdentity(1, 'Foo'), $strategy, array(), true);
}

View File

@ -252,6 +252,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase
$obj->bar = array('a', 'b');
$obj->baz = array('key' => 'val', 'key2' => 'val', 'A B' => 'bar', "Barry" => array('FooBar' => array("Baz"=>"Ed", "@id"=>1)));
$obj->qux = "1";
return $obj;
}
}

View File

@ -21,6 +21,6 @@ class FileStorageTest extends \PHPUnit_Framework_TestCase
$storage = new FileStorage('foo');
$this->assertInstanceOf('Symfony\Component\Templating\Storage\Storage', $storage, 'FileStorage is an instance of Storage');
$storage = new FileStorage(__DIR__.'/../Fixtures/templates/foo.php');
$this->assertEquals('<?php echo $foo ?>', $storage->getContent(), '->getContent() returns the content of the template');
$this->assertEquals('<?php echo $foo ?>'."\n", $storage->getContent(), '->getContent() returns the content of the template');
}
}

View File

@ -11,6 +11,7 @@ class ConstraintAValidator extends ConstraintValidator
{
if ('VALID' != $value) {
$this->setMessage('message', array('param' => 'value'));
return false;
}

View File

@ -19,6 +19,7 @@ abstract class FilesLoader extends BaseFilesLoader
protected function getFileLoaderInstance($file)
{
$this->timesCalled++;
return $this->loader;
}

View File

@ -39,4 +39,3 @@ Symfony\Tests\Component\Validator\Fixtures\Entity:
getters:
lastName:
- NotNull: ~

View File

@ -49,4 +49,3 @@ php: |
'white' => 'walls',
'blue' => 'berries',
)