10000 merged 2.0 · DavidChristmann/symfony@a8fd2c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a8fd2c4

Browse files
committed
merged 2.0
2 parents a8e8008 + 7c8d836 commit a8fd2c4

File tree

7 files changed

+57
-4
lines changed

7 files changed

+57
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/HttpKernelTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ public function getProviderTypes()
169169

170170
public function testExceptionInSubRequestsDoesNotMangleOutputBuffers()
171171
{
172+
if (version_compare(phpversion(), "5.3.2", "<=")) {
173+
$this->markTestSkipped('Test fails with PHP5.3.2 due to https://bugs.php.net/bug.php?id=50563');
174+
}
175+
172176
$request = new Request();
173177

174178
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');

src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function buildView(FormView $view, FormInterface $form)
3737
{
3838
$view
3939
->set('value', $form->getAttribute('value'))
40-
->set('checked', (Boolean) $form->getData())
40+
->set('checked', (Boolean) $form->getClientData())
4141
;
4242
}
4343

src/Symfony/Component/Form/Extension/Core/Type/RadioType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function buildView(FormView $view, FormInterface $form)
3737
{
3838
$view
3939
->set('value', $form->getAttribute('value'))
40-
->set('checked', (Boolean) $form->getData())
40+
->set('checked', (Boolean) $form->getClientData())
4141
;
4242

4343
if ($view->hasParent()) {

src/Symfony/Component/Form/Util/PropertyPath.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ protected function readProperty($object, $currentIndex)
279279
throw new InvalidPropertyException(sprintf('Index "%s" cannot be read from object of type "%s" because it doesn\'t implement \ArrayAccess', $property, get_class($object)));
280280
}
281281

282-
return $object[$property];
282+
if (isset($object[$property])) {
283+
return $object[$property];
284+
}
283285
} else {
284286
$camelProp = $this->camelize($property);
285287
$reflClass = new \ReflectionClass($object);

src/Symfony/Component/Security/Core/Authorization/Voter/VoterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function supportsClass($class);
4545
/**
4646
* Returns the vote for the given parameters.
4747
*
48-
* This method must return one of the following constant:
48+
* This method must return one of the following constants:
4949
* ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.
5050
*
5151
* @param TokenInterface $token A TokenInterface instance

tests/Symfony/Tests/Component/Form/Extension/Core/Type/CheckboxTypeTest.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Tests\Component\Form\Extension\Core\Type;
1313

14+
use Symfony\Component\Form\CallbackTransformer;
15+
1416
class CheckboxTypeTest extends TypeTestCase
1517
{
1618
public function testPassValueToView()
@@ -38,4 +40,39 @@ public function testNotCheckedIfDataFalse()
3840

3941
$this->assertFalse($view->get('checked'));
4042
}
43+
44+
/**
45+
* @dataProvider proviceTransformedData
46+
*/
47+
public function testTransformedData($data, $expected)
48+
{
49+
// present a binary status field as a checkbox
50+
$transformer = new CallbackTransformer(
51+
function ($value)
52+
{
53+
return 'expedited' == $value;
54+
},
55+
function ($value)
56+
{
57+
return $value ? 'expedited' : 'standard';
58+
}
59+
);
60+
61+
$form = $this->builder
62+
->create('expedited_shipping', 'checkbox')
63+
->prependClientTransformer($transformer)
64+
->getForm();
65+
$form->setData($data);
66+
$view = $form->createView();
67+
68+
$this->assertEquals($expected, $view->get('checked'));
69+
}
70+
71+
public function proviceTransformedData()
72+
{
73+
return array(
74+
array('expedited', true),
75+
array('standard', false),
76+
);
77+
}
4178
}

vendors.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
mkdir($vendorDir, 0777, true);
2626
}
2727

28+
// optional transport change
29+
$transport = false;
30+
if (isset($argv[1]) && in_array($argv[1], array('--transport=http', '--transport=https', '--transport=git'))) {
31+
$transport = preg_replace('/^--transport=(.*)$/', '$1', $argv[1]);
32+
}
33+
2834
$deps = array(
2935
array('doctrine', 'http://github.com/doctrine/doctrine2.git', 'origin/master'),
3036
array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'origin/master'),
@@ -36,6 +42,10 @@
3642

3743
foreach ($deps as $dep) {
3844
list($name, $url, $rev) = $dep;
45+
46+
if ($transport) {
47+
$url = preg_replace('/^(http:|https:|git:)(.*)/', $transport . ':$2', $url);
48+
}
3949

4050
$installDir = $vendorDir.'/'.$name;
4151
$install = false;

0 commit comments

Comments
 (0)
0