merged 2.0
This commit is contained in:
commit
a8fd2c4b46
@ -169,6 +169,10 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testExceptionInSubRequestsDoesNotMangleOutputBuffers()
|
public function testExceptionInSubRequestsDoesNotMangleOutputBuffers()
|
||||||
{
|
{
|
||||||
|
if (version_compare(phpversion(), "5.3.2", "<=")) {
|
||||||
|
$this->markTestSkipped('Test fails with PHP5.3.2 due to https://bugs.php.net/bug.php?id=50563');
|
||||||
|
}
|
||||||
|
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
|
|
||||||
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
|
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
|
||||||
|
@ -37,7 +37,7 @@ class CheckboxType extends AbstractType
|
|||||||
{
|
{
|
||||||
$view
|
$view
|
||||||
->set('value', $form->getAttribute('value'))
|
->set('value', $form->getAttribute('value'))
|
||||||
->set('checked', (Boolean) $form->getData())
|
->set('checked', (Boolean) $form->getClientData())
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class RadioType extends AbstractType
|
|||||||
{
|
{
|
||||||
$view
|
$view
|
||||||
->set('value', $form->getAttribute('value'))
|
->set('value', $form->getAttribute('value'))
|
||||||
->set('checked', (Boolean) $form->getData())
|
->set('checked', (Boolean) $form->getClientData())
|
||||||
;
|
;
|
||||||
|
|
||||||
if ($view->hasParent()) {
|
if ($view->hasParent()) {
|
||||||
|
@ -279,7 +279,9 @@ class PropertyPath implements \IteratorAggregate
|
|||||||
throw new InvalidPropertyException(sprintf('Index "%s" cannot be read from object of type "%s" because it doesn\'t implement \ArrayAccess', $property, get_class($object)));
|
throw new InvalidPropertyException(sprintf('Index "%s" cannot be read from object of type "%s" because it doesn\'t implement \ArrayAccess', $property, get_class($object)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $object[$property];
|
if (isset($object[$property])) {
|
||||||
|
return $object[$property];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$camelProp = $this->camelize($property);
|
$camelProp = $this->camelize($property);
|
||||||
$reflClass = new \ReflectionClass($object);
|
$reflClass = new \ReflectionClass($object);
|
||||||
|
@ -45,7 +45,7 @@ interface VoterInterface
|
|||||||
/**
|
/**
|
||||||
* Returns the vote for the given parameters.
|
* Returns the vote for the given parameters.
|
||||||
*
|
*
|
||||||
* This method must return one of the following constant:
|
* This method must return one of the following constants:
|
||||||
* ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.
|
* ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.
|
||||||
*
|
*
|
||||||
* @param TokenInterface $token A TokenInterface instance
|
* @param TokenInterface $token A TokenInterface instance
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Tests\Component\Form\Extension\Core\Type;
|
namespace Symfony\Tests\Component\Form\Extension\Core\Type;
|
||||||
|
|
||||||
|
use Symfony\Component\Form\CallbackTransformer;
|
||||||
|
|
||||||
class CheckboxTypeTest extends TypeTestCase
|
class CheckboxTypeTest extends TypeTestCase
|
||||||
{
|
{
|
||||||
public function testPassValueToView()
|
public function testPassValueToView()
|
||||||
@ -38,4 +40,39 @@ class CheckboxTypeTest extends TypeTestCase
|
|||||||
|
|
||||||
$this->assertFalse($view->get('checked'));
|
$this->assertFalse($view->get('checked'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider proviceTransformedData
|
||||||
|
*/
|
||||||
|
public function testTransformedData($data, $expected)
|
||||||
|
{
|
||||||
|
// present a binary status field as a checkbox
|
||||||
|
$transformer = new CallbackTransformer(
|
||||||
|
function ($value)
|
||||||
|
{
|
||||||
|
return 'expedited' == $value;
|
||||||
|
},
|
||||||
|
function ($value)
|
||||||
|
{
|
||||||
|
return $value ? 'expedited' : 'standard';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$form = $this->builder
|
||||||
|
->create('expedited_shipping', 'checkbox')
|
||||||
|
->prependClientTransformer($transformer)
|
||||||
|
->getForm();
|
||||||
|
$form->setData($data);
|
||||||
|
$view = $form->createView();
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $view->get('checked'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function proviceTransformedData()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('expedited', true),
|
||||||
|
array('standard', false),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
10
vendors.php
10
vendors.php
@ -25,6 +25,12 @@ if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
|
|||||||
mkdir($vendorDir, 0777, true);
|
mkdir($vendorDir, 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// optional transport change
|
||||||
|
$transport = false;
|
||||||
|
if (isset($argv[1]) && in_array($argv[1], array('--transport=http', '--transport=https', '--transport=git'))) {
|
||||||
|
$transport = preg_replace('/^--transport=(.*)$/', '$1', $argv[1]);
|
||||||
|
}
|
||||||
|
|
||||||
$deps = array(
|
$deps = array(
|
||||||
array('doctrine', 'http://github.com/doctrine/doctrine2.git', 'origin/master'),
|
array('doctrine', 'http://github.com/doctrine/doctrine2.git', 'origin/master'),
|
||||||
array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'origin/master'),
|
array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'origin/master'),
|
||||||
@ -36,6 +42,10 @@ $deps = array(
|
|||||||
|
|
||||||
foreach ($deps as $dep) {
|
foreach ($deps as $dep) {
|
||||||
list($name, $url, $rev) = $dep;
|
list($name, $url, $rev) = $dep;
|
||||||
|
|
||||||
|
if ($transport) {
|
||||||
|
$url = preg_replace('/^(http:|https:|git:)(.*)/', $transport . ':$2', $url);
|
||||||
|
}
|
||||||
|
|
||||||
$installDir = $vendorDir.'/'.$name;
|
$installDir = $vendorDir.'/'.$name;
|
||||||
$install = false;
|
$install = false;
|
||||||
|
Reference in New Issue
Block a user