Merge branch '3.4' into 4.1
* 3.4: [Form] Hardened test suite for empty data Bump phpunit XSD version to 5.2 [Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables Add required key attribute
This commit is contained in:
commit
913781baac
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
@ -62,13 +62,13 @@
|
|||||||
<array>
|
<array>
|
||||||
<element key="time-sensitive">
|
<element key="time-sensitive">
|
||||||
<array>
|
<array>
|
||||||
<element><string>Cache\IntegrationTests</string></element>
|
<element key="0"><string>Cache\IntegrationTests</string></element>
|
||||||
<element><string>Doctrine\Common\Cache</string></element>
|
<element key="1"><string>Doctrine\Common\Cache</string></element>
|
||||||
<element><string>Symfony\Component\Cache</string></element>
|
<element key="2"><string>Symfony\Component\Cache</string></element>
|
||||||
<element><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
|
<element key="3"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
|
||||||
<element><string>Symfony\Component\Cache\Traits</string></element>
|
<element key="4"><string>Symfony\Component\Cache\Traits</string></element>
|
||||||
<element><string>Symfony\Component\Console</string></element>
|
<element key="5"><string>Symfony\Component\Console</string></element>
|
||||||
<element><string>Symfony\Component\HttpFoundation</string></element>
|
<element key="6"><string>Symfony\Component\HttpFoundation</string></element>
|
||||||
</array>
|
</array>
|
||||||
</element>
|
</element>
|
||||||
</array>
|
</array>
|
||||||
|
@ -1482,4 +1482,43 @@ class EntityTypeTest extends BaseTypeTest
|
|||||||
$this->assertEquals(array(), $form->getNormData());
|
$this->assertEquals(array(), $form->getNormData());
|
||||||
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
|
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null)
|
||||||
|
{
|
||||||
|
$emptyData = '1';
|
||||||
|
$entity1 = new SingleIntIdEntity(1, 'Foo');
|
||||||
|
$this->persist(array($entity1));
|
||||||
|
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'em' => 'default',
|
||||||
|
'class' => self::SINGLE_IDENT_CLASS,
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertSame($entity1, $form->getNormData());
|
||||||
|
$this->assertSame($entity1, $form->getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullMultipleUsesDefaultEmptyData()
|
||||||
|
{
|
||||||
|
$emptyData = array('1');
|
||||||
|
$entity1 = new SingleIntIdEntity(1, 'Foo');
|
||||||
|
$this->persist(array($entity1));
|
||||||
|
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'em' => 'default',
|
||||||
|
'class' => self::SINGLE_IDENT_CLASS,
|
||||||
|
'multiple' => true,
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$collection = new ArrayCollection(array($entity1));
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertEquals($collection, $form->getNormData());
|
||||||
|
$this->assertEquals($collection, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -346,10 +346,9 @@ class JsonDescriptor extends Descriptor
|
|||||||
}
|
}
|
||||||
$data['name'] = $r->name;
|
$data['name'] = $r->name;
|
||||||
|
|
||||||
$class = ($class = $r->getClosureThis()) ? \get_class($class) : null;
|
if ($class = $r->getClosureScopeClass()) {
|
||||||
if ($scopeClass = $r->getClosureScopeClass() ?: $class) {
|
$data['class'] = $class->name;
|
||||||
$data['class'] = $scopeClass;
|
if (!$r->getClosureThis()) {
|
||||||
if (!$class) {
|
|
||||||
$data['static'] = true;
|
$data['static'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,10 +353,9 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
}
|
}
|
||||||
$string .= "\n".sprintf('- Name: `%s`', $r->name);
|
$string .= "\n".sprintf('- Name: `%s`', $r->name);
|
||||||
|
|
||||||
$class = ($class = $r->getClosureThis()) ? \get_class($class) : null;
|
if ($class = $r->getClosureScopeClass()) {
|
||||||
if ($scopeClass = $r->getClosureScopeClass() ?: $class) {
|
$string .= "\n".sprintf('- Class: `%s`', $class->name);
|
||||||
$string .= "\n".sprintf('- Class: `%s`', $class);
|
if (!$r->getClosureThis()) {
|
||||||
if (!$class) {
|
|
||||||
$string .= "\n- Static: yes";
|
$string .= "\n- Static: yes";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -453,10 +453,7 @@ class TextDescriptor extends Descriptor
|
|||||||
return 'Closure()';
|
return 'Closure()';
|
||||||
}
|
}
|
||||||
if ($class = $r->getClosureScopeClass()) {
|
if ($class = $r->getClosureScopeClass()) {
|
||||||
return sprintf('%s::%s()', $class, $r->name);
|
return sprintf('%s::%s()', $class->name, $r->name);
|
||||||
}
|
|
||||||
if ($class = $r->getClosureThis()) {
|
|
||||||
return sprintf('%s::%s()', \get_class($class), $r->name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $r->name.'()';
|
return $r->name.'()';
|
||||||
|
@ -524,10 +524,9 @@ class XmlDescriptor extends Descriptor
|
|||||||
}
|
}
|
||||||
$callableXML->setAttribute('name', $r->name);
|
$callableXML->setAttribute('name', $r->name);
|
||||||
|
|
||||||
$class = ($class = $r->getClosureThis()) ? \get_class($class) : null;
|
if ($class = $r->getClosureScopeClass()) {
|
||||||
if ($scopeClass = $r->getClosureScopeClass() ?: $class) {
|
$callableXML->setAttribute('class', $class->name);
|
||||||
$callableXML->setAttribute('class', $class);
|
if (!$r->getClosureThis()) {
|
||||||
if (!$class) {
|
|
||||||
$callableXML->setAttribute('static', 'true');
|
$callableXML->setAttribute('static', 'true');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ class ObjectsProvider
|
|||||||
|
|
||||||
public static function getCallables()
|
public static function getCallables()
|
||||||
{
|
{
|
||||||
return array(
|
$callables = array(
|
||||||
'callable_1' => 'array_key_exists',
|
'callable_1' => 'array_key_exists',
|
||||||
'callable_2' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'),
|
'callable_2' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'),
|
||||||
'callable_3' => array(new CallableClass(), 'method'),
|
'callable_3' => array(new CallableClass(), 'method'),
|
||||||
@ -164,6 +164,12 @@ class ObjectsProvider
|
|||||||
'callable_6' => function () { return 'Closure'; },
|
'callable_6' => function () { return 'Closure'; },
|
||||||
'callable_7' => new CallableClass(),
|
'callable_7' => new CallableClass(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (\PHP_VERSION_ID >= 70100) {
|
||||||
|
$callables['callable_from_callable'] = \Closure::fromCallable(new CallableClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $callables;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"type": "closure",
|
||||||
|
"name": "__invoke",
|
||||||
|
"class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass"
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
- Type: `closure`
|
||||||
|
- Name: `__invoke`
|
||||||
|
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
|
@ -0,0 +1 @@
|
|||||||
|
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()
|
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<callable type="closure" name="__invoke" class="Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass"/>
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
@ -36,11 +36,11 @@
|
|||||||
<array>
|
<array>
|
||||||
<element key="time-sensitive">
|
<element key="time-sensitive">
|
||||||
<array>
|
<array>
|
||||||
<element><string>Cache\IntegrationTests</string></element>
|
<element key="0"><string>Cache\IntegrationTests</string></element>
|
||||||
<element><string>Doctrine\Common\Cache</string></element>
|
<element key="1"><string>Doctrine\Common\Cache</string></element>
|
||||||
<element><string>Symfony\Component\Cache</string></element>
|
<element key="2"><string>Symfony\Component\Cache</string></element>
|
||||||
<element><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
|
<element key="3"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
|
||||||
<element><string>Symfony\Component\Cache\Traits</string></element>
|
<element key="4"><string>Symfony\Component\Cache\Traits</string></element>
|
||||||
</array>
|
</array>
|
||||||
</element>
|
</element>
|
||||||
</array>
|
</array>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -46,10 +46,8 @@ class WrappedListener
|
|||||||
$r = new \ReflectionFunction($listener);
|
$r = new \ReflectionFunction($listener);
|
||||||
if (false !== strpos($r->name, '{closure}')) {
|
if (false !== strpos($r->name, '{closure}')) {
|
||||||
$this->pretty = $this->name = 'closure';
|
$this->pretty = $this->name = 'closure';
|
||||||
} elseif ($this->name = $r->getClosureScopeClass()) {
|
} elseif ($class = $r->getClosureScopeClass()) {
|
||||||
$this->pretty = $this->name.'::'.$r->name;
|
$this->name = $class->name;
|
||||||
} elseif ($class = $r->getClosureThis()) {
|
|
||||||
$this->name = \get_class($class);
|
|
||||||
$this->pretty = $this->name.'::'.$r->name;
|
$this->pretty = $this->name.'::'.$r->name;
|
||||||
} else {
|
} else {
|
||||||
$this->pretty = $this->name = $r->name;
|
$this->pretty = $this->name = $r->name;
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\EventDispatcher\Tests\Debug;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Symfony\Component\EventDispatcher\Debug\WrappedListener;
|
||||||
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\Stopwatch\Stopwatch;
|
||||||
|
|
||||||
|
class WrappedListenerTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @dataProvider provideListenersToDescribe
|
||||||
|
*/
|
||||||
|
public function testListenerDescription(callable $listener, $expected)
|
||||||
|
{
|
||||||
|
$wrappedListener = new WrappedListener($listener, null, $this->getMockBuilder(Stopwatch::class)->getMock(), $this->getMockBuilder(EventDispatcherInterface::class)->getMock());
|
||||||
|
|
||||||
|
$this->assertStringMatchesFormat($expected, $wrappedListener->getPretty());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function provideListenersToDescribe()
|
||||||
|
{
|
||||||
|
$listeners = array(
|
||||||
|
array(new FooListener(), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::__invoke'),
|
||||||
|
array(array(new FooListener(), 'listen'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'),
|
||||||
|
array(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'),
|
||||||
|
array('var_dump', 'var_dump'),
|
||||||
|
array(function () {}, 'closure'),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (\PHP_VERSION_ID >= 70100) {
|
||||||
|
$listeners[] = array(\Closure::fromCallable(array(new FooListener(), 'listen')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen');
|
||||||
|
$listeners[] = array(\Closure::fromCallable(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic');
|
||||||
|
$listeners[] = array(\Closure::fromCallable(function () {}), 'closure');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $listeners;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FooListener
|
||||||
|
{
|
||||||
|
public function listen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function listenStatic()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -145,6 +145,28 @@ abstract class BaseTypeTest extends TypeTestCase
|
|||||||
$this->assertSame($view, $form->getViewData());
|
$this->assertSame($view, $form->getViewData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null)
|
||||||
|
{
|
||||||
|
$builder = $this->factory->createBuilder($this->getTestedType());
|
||||||
|
|
||||||
|
if ($builder->getCompound()) {
|
||||||
|
$emptyData = array();
|
||||||
|
foreach ($builder as $field) {
|
||||||
|
// empty children should map null (model data) in the compound view data
|
||||||
|
$emptyData[$field->getName()] = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// simple fields share the view and the model format, unless they use a transformer
|
||||||
|
$expectedData = $emptyData;
|
||||||
|
}
|
||||||
|
|
||||||
|
$form = $builder->setEmptyData($emptyData)->getForm()->submit(null);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
|
|
||||||
protected function getTestedType()
|
protected function getTestedType()
|
||||||
{
|
{
|
||||||
return static::TESTED_TYPE;
|
return static::TESTED_TYPE;
|
||||||
|
@ -22,4 +22,16 @@ class ButtonTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
$this->assertInstanceOf('Symfony\Component\Form\Button', $this->factory->create(static::TESTED_TYPE));
|
$this->assertInstanceOf('Symfony\Component\Form\Button', $this->factory->create(static::TESTED_TYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \Symfony\Component\Form\Exception\BadMethodCallException
|
||||||
|
* @expectedExceptionMessage Buttons do not support empty data.
|
||||||
|
*
|
||||||
|
* @param string $emptyData
|
||||||
|
* @param null $expectedData
|
||||||
|
*/
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null)
|
||||||
|
{
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,4 +209,17 @@ class CheckboxTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull(false, false, null);
|
parent::testSubmitNull(false, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = true)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
// view data is transformed to the string true value
|
||||||
|
$this->assertSame('1', $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -584,18 +584,19 @@ class ChoiceTypeTest extends BaseTypeTest
|
|||||||
$this->assertTrue($form->isSynchronized());
|
$this->assertTrue($form->isSynchronized());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSubmitSingleChoiceWithEmptyData()
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null)
|
||||||
{
|
{
|
||||||
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => false,
|
'expanded' => false,
|
||||||
'choices' => array('test'),
|
// empty data must match string choice value
|
||||||
'empty_data' => 'test',
|
'choices' => array($emptyData),
|
||||||
|
'empty_data' => $emptyData,
|
||||||
));
|
));
|
||||||
|
|
||||||
$form->submit(null);
|
$form->submit(null);
|
||||||
|
|
||||||
$this->assertSame('test', $form->getData());
|
$this->assertSame($emptyData, $form->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSubmitSingleChoiceWithEmptyDataAndInitialData()
|
public function testSubmitSingleChoiceWithEmptyDataAndInitialData()
|
||||||
|
@ -408,4 +408,10 @@ class CollectionTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull(array(), array(), array());
|
parent::testSubmitNull(array(), array(), array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = array(), $expectedData = array())
|
||||||
|
{
|
||||||
|
// resize form listener always set an empty array
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,4 +75,9 @@ class CountryTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'FR', $expectedData = 'FR')
|
||||||
|
{
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,4 +56,9 @@ class CurrencyTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'EUR', $expectedData = 'EUR')
|
||||||
|
{
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,4 +410,17 @@ class DateIntervalTypeTest extends BaseTypeTest
|
|||||||
'days' => '',
|
'days' => '',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = array(), $expectedData = null)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
// view transformer writes back empty strings in the view data
|
||||||
|
$this->assertSame(array('years' => '', 'months' => '', 'days' => ''), $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -628,4 +628,20 @@ class DateTimeTypeTest extends BaseTypeTest
|
|||||||
$this->assertNull($form->getNormData());
|
$this->assertNull($form->getNormData());
|
||||||
$this->assertSame('', $form->getViewData());
|
$this->assertSame('', $form->getViewData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = array(), $expectedData = null)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
// view transformer writes back empty strings in the view data
|
||||||
|
$this->assertSame(
|
||||||
|
array('date' => array('year' => '', 'month' => '', 'day' => ''), 'time' => array('hour' => '', 'minute' => '')),
|
||||||
|
$form->getViewData()
|
||||||
|
);
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -997,4 +997,33 @@ class DateTypeTest extends BaseTypeTest
|
|||||||
$this->assertNull($form->getNormData());
|
$this->assertNull($form->getNormData());
|
||||||
$this->assertSame('', $form->getViewData());
|
$this->assertSame('', $form->getViewData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = array(), $expectedData = null)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
// view transformer write back empty strings in the view data
|
||||||
|
$this->assertSame(array('year' => '', 'month' => '', 'day' => ''), $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSingleTextSubmitNullUsesDefaultEmptyData()
|
||||||
|
{
|
||||||
|
$emptyData = '2018-11-11';
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'widget' => 'single_text',
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$date = new \DateTime($emptyData);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertEquals($date, $form->getNormData());
|
||||||
|
$this->assertEquals($date, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,6 +170,11 @@ class FormTypeTest extends BaseTypeTest
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = array(), $expectedData = array())
|
||||||
|
{
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
|
|
||||||
public function testSubmitWithEmptyDataCreatesObjectIfClassAvailable()
|
public function testSubmitWithEmptyDataCreatesObjectIfClassAvailable()
|
||||||
{
|
{
|
||||||
$form = $this->factory->createBuilder(static::TESTED_TYPE, null, array(
|
$form = $this->factory->createBuilder(static::TESTED_TYPE, null, array(
|
||||||
|
@ -38,4 +38,16 @@ class IntegerTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = '10', $expectedData = 10)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,4 +68,9 @@ class LanguageTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'en', $expectedData = 'en')
|
||||||
|
{
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,4 +56,9 @@ class LocaleTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'en', $expectedData = 'en')
|
||||||
|
{
|
||||||
|
parent::testSubmitNullUsesDefaultEmptyData($emptyData, $expectedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,18 @@ class MoneyTypeTest extends BaseTypeTest
|
|||||||
$this->assertSame('{{ widget }}', $view->vars['money_pattern']);
|
$this->assertSame('{{ widget }}', $view->vars['money_pattern']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = '10.00', $expectedData = 10.0)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
|
|
||||||
public function testDefaultFormattingWithDefaultRounding()
|
public function testDefaultFormattingWithDefaultRounding()
|
||||||
{
|
{
|
||||||
$form = $this->factory->create(static::TESTED_TYPE, null, array('scale' => 0));
|
$form = $this->factory->create(static::TESTED_TYPE, null, array('scale' => 0));
|
||||||
|
@ -63,4 +63,16 @@ class NumberTypeTest extends BaseTypeTest
|
|||||||
{
|
{
|
||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = '10', $expectedData = 10.0)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -790,4 +790,17 @@ class TimeTypeTest extends BaseTypeTest
|
|||||||
|
|
||||||
parent::testSubmitNull($expected, $norm, $view);
|
parent::testSubmitNull($expected, $norm, $view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = array(), $expectedData = null)
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
// view transformer write back empty strings in the view data
|
||||||
|
$this->assertSame(array('hour' => '', 'minute' => ''), $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,18 @@ class TimezoneTypeTest extends BaseTypeTest
|
|||||||
parent::testSubmitNull($expected, $norm, '');
|
parent::testSubmitNull($expected, $norm, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'Africa/Kinshasa', $expectedData = 'Africa/Kinshasa')
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
$this->assertSame($emptyData, $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
|
|
||||||
public function testDateTimeZoneInput()
|
public function testDateTimeZoneInput()
|
||||||
{
|
{
|
||||||
$form = $this->factory->create(static::TESTED_TYPE, new \DateTimeZone('America/New_York'), array('input' => 'datetimezone'));
|
$form = $this->factory->create(static::TESTED_TYPE, new \DateTimeZone('America/New_York'), array('input' => 'datetimezone'));
|
||||||
|
@ -90,4 +90,17 @@ class UrlTypeTest extends TextTypeTest
|
|||||||
|
|
||||||
$this->assertSame(array('domain.com', 'www.domain.com'), $form->getData());
|
$this->assertSame(array('domain.com', 'www.domain.com'), $form->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = 'http://empty')
|
||||||
|
{
|
||||||
|
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||||
|
'empty_data' => $emptyData,
|
||||||
|
));
|
||||||
|
$form->submit(null);
|
||||||
|
|
||||||
|
// listener normalizes data on submit
|
||||||
|
$this->assertSame($expectedData, $form->getViewData());
|
||||||
|
$this->assertSame($expectedData, $form->getNormData());
|
||||||
|
$this->assertSame($expectedData, $form->getData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -415,9 +415,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
|||||||
$controller['method'] = $r->name;
|
$controller['method'] = $r->name;
|
||||||
|
|
||||||
if ($class = $r->getClosureScopeClass()) {
|
if ($class = $r->getClosureScopeClass()) {
|
||||||
$controller['class'] = $class;
|
$controller['class'] = $class->name;
|
||||||
} elseif ($class = $r->getClosureThis()) {
|
|
||||||
$controller['class'] = \get_class($class);
|
|
||||||
} else {
|
} else {
|
||||||
return $r->name;
|
return $r->name;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -39,13 +39,7 @@ class ReflectionCaster
|
|||||||
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
||||||
|
|
||||||
if (false === strpos($c->name, '{closure}')) {
|
if (false === strpos($c->name, '{closure}')) {
|
||||||
if (isset($a[$prefix.'class'])) {
|
$stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name;
|
||||||
$stub->class = $a[$prefix.'class']->value.'::'.$c->name;
|
|
||||||
} elseif (isset($a[$prefix.'this'])) {
|
|
||||||
$stub->class = $a[$prefix.'this']->class.'::'.$c->name;
|
|
||||||
} else {
|
|
||||||
$stub->class = $c->name;
|
|
||||||
}
|
|
||||||
unset($a[$prefix.'class']);
|
unset($a[$prefix.'class']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
|
Reference in New Issue
Block a user