fixed CS
This commit is contained in:
parent
db1d145b35
commit
26f933e7bd
1
check_cs
1
check_cs
@ -28,6 +28,7 @@ $finder
|
|||||||
->name('*.yml')
|
->name('*.yml')
|
||||||
->in(__DIR__.'/src')
|
->in(__DIR__.'/src')
|
||||||
->notName(basename(__FILE__))
|
->notName(basename(__FILE__))
|
||||||
|
->notName('sfTests.yml')
|
||||||
->exclude('.git')
|
->exclude('.git')
|
||||||
->exclude('vendor')
|
->exclude('vendor')
|
||||||
;
|
;
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Bridge\Propel1\Tests\Fixtures;
|
namespace Symfony\Bridge\Propel1\Tests\Fixtures;
|
||||||
|
|
||||||
use \PropelPDO;
|
|
||||||
|
|
||||||
class ReadOnlyItem extends \BaseObject
|
class ReadOnlyItem extends \BaseObject
|
||||||
{
|
{
|
||||||
public function getName()
|
public function getName()
|
||||||
|
@ -326,4 +326,4 @@
|
|||||||
{% block field_enctype %}{{ block('form_enctype') }}{% endblock %}
|
{% block field_enctype %}{{ block('form_enctype') }}{% endblock %}
|
||||||
{% block field_errors %}{{ block('form_errors') }}{% endblock %}
|
{% block field_errors %}{{ block('form_errors') }}{% endblock %}
|
||||||
{% block field_rest %}{{ block('form_rest') }}{% endblock %}
|
{% block field_rest %}{{ block('form_rest') }}{% endblock %}
|
||||||
{% block field_rows %}{{ block('form_rows') }}{% endblock %}
|
{% block field_rows %}{{ block('form_rows') }}{% endblock %}
|
||||||
|
@ -644,7 +644,7 @@ class FrameworkExtension extends Extension
|
|||||||
->replaceArgument(2, $config['debug'])
|
->replaceArgument(2, $config['debug'])
|
||||||
;
|
;
|
||||||
$container->setAlias('annotation_reader', 'annotations.file_cache_reader');
|
$container->setAlias('annotation_reader', 'annotations.file_cache_reader');
|
||||||
} else if('none' !== $config['cache']) {
|
} elseif ('none' !== $config['cache']) {
|
||||||
$container
|
$container
|
||||||
->getDefinition('annotations.cached_reader')
|
->getDefinition('annotations.cached_reader')
|
||||||
->replaceArgument(1, new Reference($config['cache']))
|
->replaceArgument(1, new Reference($config['cache']))
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('widget_attributes') ?>
|
<?php echo $view['form']->renderBlock('widget_attributes') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('choice_widget_options') ?>
|
<?php echo $view['form']->renderBlock('choice_widget_options') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('widget_container_attributes') ?>
|
<?php echo $view['form']->renderBlock('widget_container_attributes') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_enctype') ?>
|
<?php echo $view['form']->renderBlock('form_enctype') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_errors') ?>
|
<?php echo $view['form']->renderBlock('form_errors') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_label') ?>
|
<?php echo $view['form']->renderBlock('form_label') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_rest') ?>
|
<?php echo $view['form']->renderBlock('form_rest') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_row') ?>
|
<?php echo $view['form']->renderBlock('form_row') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_rows') ?>
|
<?php echo $view['form']->renderBlock('form_rows') ?>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?php echo $view['form']->renderBlock('form_widget_single_control') ?>
|
<?php echo $view['form']->renderBlock('form_widget_single_control') ?>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div <?php echo $view['form']->renderBlock('widget_container_attributes') ?>>
|
<div <?php echo $view['form']->renderBlock('widget_container_attributes') ?>>
|
||||||
<?php echo $view['form']->renderBlock('form_rows') ?>
|
<?php echo $view['form']->renderBlock('form_rows') ?>
|
||||||
<?php echo $view['form']->rest($form) ?>
|
<?php echo $view['form']->rest($form) ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,4 +48,4 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -263,4 +263,4 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -41,4 +41,4 @@
|
|||||||
<em><small>Note: The above matching is based on the configuration for the current router which might differ from
|
<em><small>Note: The above matching is based on the configuration for the current router which might differ from
|
||||||
the configuration used while routing this request.</small></em>
|
the configuration used while routing this request.</small></em>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -154,6 +154,7 @@ class ClassCollectionLoader
|
|||||||
$inNamespace = false;
|
$inNamespace = false;
|
||||||
--$i;
|
--$i;
|
||||||
} else {
|
} else {
|
||||||
|
$output = rtrim($output);
|
||||||
$output .= "\n{";
|
$output .= "\n{";
|
||||||
$inNamespace = true;
|
$inNamespace = true;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ class ClassLoader
|
|||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
*
|
*
|
||||||
* @return Boolean|null True, if loaded
|
* @return Boolean|null True, if loaded
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
|
@ -73,7 +73,7 @@ class DebugClassLoader
|
|||||||
* Loads the given class or interface.
|
* Loads the given class or interface.
|
||||||
*
|
*
|
||||||
* @param string $class The name of the class
|
* @param string $class The name of the class
|
||||||
*
|
*
|
||||||
* @return Boolean|null True, if loaded
|
* @return Boolean|null True, if loaded
|
||||||
*/
|
*/
|
||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
|
@ -43,7 +43,7 @@ namespace Foo
|
|||||||
{
|
{
|
||||||
class Foo {}
|
class Foo {}
|
||||||
}
|
}
|
||||||
namespace Bar
|
namespace Bar
|
||||||
{
|
{
|
||||||
class Foo {}
|
class Foo {}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ You can run the unit tests with the following command:
|
|||||||
phpunit -c src/Symfony/Component/Console
|
phpunit -c src/Symfony/Component/Console
|
||||||
|
|
||||||
Resources
|
Resources
|
||||||
---------
|
---------
|
||||||
|
|
||||||
[The Console Component](http://symfony.com/doc/current/components/console.html)
|
[The Console Component](http://symfony.com/doc/current/components/console.html)
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ class Container implements IntrospectableContainerInterface
|
|||||||
throw new ServiceNotFoundException($id);
|
throw new ServiceNotFoundException($id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the given service has actually been initialized
|
* Returns true if the given service has actually been initialized
|
||||||
*
|
*
|
||||||
|
@ -11,11 +11,12 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\DependencyInjection\Dumper;
|
namespace Symfony\Component\DependencyInjection\Dumper;
|
||||||
|
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Dumper as YmlDumper;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Parameter;
|
use Symfony\Component\DependencyInjection\Parameter;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* YamlDumper dumps a service container as a YAML string.
|
* YamlDumper dumps a service container as a YAML string.
|
||||||
@ -26,6 +27,22 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
|||||||
*/
|
*/
|
||||||
class YamlDumper extends Dumper
|
class YamlDumper extends Dumper
|
||||||
{
|
{
|
||||||
|
private $dumper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param ContainerBuilder $container The service container to dump
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
public function __construct(ContainerBuilder $container)
|
||||||
|
{
|
||||||
|
parent::__construct($container);
|
||||||
|
|
||||||
|
$this->dumper = new YmlDumper();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dumps the service container as an YAML string.
|
* Dumps the service container as an YAML string.
|
||||||
*
|
*
|
||||||
@ -60,11 +77,11 @@ class YamlDumper extends Dumper
|
|||||||
foreach ($tags as $attributes) {
|
foreach ($tags as $attributes) {
|
||||||
$att = array();
|
$att = array();
|
||||||
foreach ($attributes as $key => $value) {
|
foreach ($attributes as $key => $value) {
|
||||||
$att[] = sprintf('%s: %s', Yaml::dump($key), Yaml::dump($value));
|
$att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value));
|
||||||
}
|
}
|
||||||
$att = $att ? ', '.implode(' ', $att) : '';
|
$att = $att ? ', '.implode(' ', $att) : '';
|
||||||
|
|
||||||
$tagsCode .= sprintf(" - { name: %s%s }\n", Yaml::dump($name), $att);
|
$tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($tagsCode) {
|
if ($tagsCode) {
|
||||||
@ -84,15 +101,15 @@ class YamlDumper extends Dumper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($definition->getArguments()) {
|
if ($definition->getArguments()) {
|
||||||
$code .= sprintf(" arguments: %s\n", Yaml::dump($this->dumpValue($definition->getArguments()), 0));
|
$code .= sprintf(" arguments: %s\n", $this->dumper->dump($this->dumpValue($definition->getArguments()), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($definition->getProperties()) {
|
if ($definition->getProperties()) {
|
||||||
$code .= sprintf(" properties: %s\n", Yaml::dump($this->dumpValue($definition->getProperties()), 0));
|
$code .= sprintf(" properties: %s\n", $this->dumper->dump($this->dumpValue($definition->getProperties()), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($definition->getMethodCalls()) {
|
if ($definition->getMethodCalls()) {
|
||||||
$code .= sprintf(" calls:\n %s\n", str_replace("\n", "\n ", Yaml::dump($this->dumpValue($definition->getMethodCalls()), 1)));
|
$code .= sprintf(" calls:\n%s\n", $this->dumper->dump($this->dumpValue($definition->getMethodCalls()), 1, 12));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) {
|
if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) {
|
||||||
@ -108,7 +125,7 @@ class YamlDumper extends Dumper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$code .= sprintf(" configurator: %s\n", Yaml::dump($callable, 0));
|
$code .= sprintf(" configurator: %s\n", $this->dumper->dump($callable, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
@ -171,7 +188,7 @@ class YamlDumper extends Dumper
|
|||||||
$parameters = $this->container->getParameterBag()->all();
|
$parameters = $this->container->getParameterBag()->all();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Yaml::dump(array('parameters' => $parameters), 2);
|
return $this->dumper->dump(array('parameters' => $parameters), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,10 +24,10 @@ interface IntrospectableContainerInterface extends ContainerInterface
|
|||||||
* Check for whether or not a service has been initialized.
|
* Check for whether or not a service has been initialized.
|
||||||
*
|
*
|
||||||
* @param string $id
|
* @param string $id
|
||||||
*
|
*
|
||||||
* @return Boolean true if the service has been initialized, false otherwise
|
* @return Boolean true if the service has been initialized, false otherwise
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function initialized($id);
|
function initialized($id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ If your service is retrieved by calling a static method:
|
|||||||
|
|
||||||
File Include:
|
File Include:
|
||||||
|
|
||||||
For some services, especially those that are difficult or impossible to
|
For some services, especially those that are difficult or impossible to
|
||||||
autoload, you may need the container to include a file before
|
autoload, you may need the container to include a file before
|
||||||
instantiating your class.
|
instantiating your class.
|
||||||
|
|
||||||
$sc = new ContainerBuilder();
|
$sc = new ContainerBuilder();
|
||||||
|
@ -104,6 +104,7 @@ class ProjectServiceContainer extends Container
|
|||||||
protected function getFooBarService()
|
protected function getFooBarService()
|
||||||
{
|
{
|
||||||
$class = $this->getParameter('foo_class');
|
$class = $this->getParameter('foo_class');
|
||||||
|
|
||||||
return $this->services['foo_bar'] = new $class();
|
return $this->services['foo_bar'] = new $class();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ services:
|
|||||||
calls:
|
calls:
|
||||||
- [setBar, ['@bar']]
|
- [setBar, ['@bar']]
|
||||||
- [initialize, { }]
|
- [initialize, { }]
|
||||||
|
|
||||||
scope: prototype
|
scope: prototype
|
||||||
configurator: sc_configure
|
configurator: sc_configure
|
||||||
bar:
|
bar:
|
||||||
@ -36,7 +36,7 @@ services:
|
|||||||
- [setBar, ['@?foo2']]
|
- [setBar, ['@?foo2']]
|
||||||
- [setBar, ['@?foo3']]
|
- [setBar, ['@?foo3']]
|
||||||
- [setBar, ['@?foobaz']]
|
- [setBar, ['@?foobaz']]
|
||||||
|
|
||||||
factory_service:
|
factory_service:
|
||||||
factory_method: getInstance
|
factory_method: getInstance
|
||||||
factory_service: foo.baz
|
factory_service: foo.baz
|
||||||
|
@ -558,7 +558,7 @@ class Finder implements \IteratorAggregate, \Countable
|
|||||||
throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
|
throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts all the results collected by the iterators.
|
* Counts all the results collected by the iterators.
|
||||||
*
|
*
|
||||||
|
@ -320,33 +320,33 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
|
|
||||||
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());
|
$this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCountDirectories()
|
public function testCountDirectories()
|
||||||
{
|
{
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$directory = $finder->directories()->in(self::$tmpDir);
|
$directory = $finder->directories()->in(self::$tmpDir);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
foreach ($directory as $dir) {
|
foreach ($directory as $dir) {
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertCount($i, $directory);
|
$this->assertCount($i, $directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCountFiles()
|
public function testCountFiles()
|
||||||
{
|
{
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$files = $finder->files()->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
$files = $finder->files()->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertCount($i, $files);
|
$this->assertCount($i, $files);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCountWithoutIn()
|
public function testCountWithoutIn()
|
||||||
{
|
{
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
|
@ -62,4 +62,4 @@ class TestMultiplePcreFilterIterator extends MultiplePcreFilterIterator
|
|||||||
{
|
{
|
||||||
throw new \BadFunctionCallException('Not implemented');
|
throw new \BadFunctionCallException('Not implemented');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,4 +69,4 @@ CHANGELOG
|
|||||||
* added method `guessPattern` to FormTypeGuesserInterface to guess which pattern to use in the HTML5 attribute "pattern"
|
* added method `guessPattern` to FormTypeGuesserInterface to guess which pattern to use in the HTML5 attribute "pattern"
|
||||||
* deprecated method `guessMinLength` in favor of `guessPattern`
|
* deprecated method `guessMinLength` in favor of `guessPattern`
|
||||||
* labels don't display field attributes anymore. Label attributes can be
|
* labels don't display field attributes anymore. Label attributes can be
|
||||||
passed in the "label_attr" option/variable
|
passed in the "label_attr" option/variable
|
||||||
|
@ -317,4 +317,4 @@ class DefaultOptions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,4 +70,4 @@ class LazyOption
|
|||||||
|
|
||||||
return $this->closure->__invoke($options, $this->previousValue);
|
return $this->closure->__invoke($options, $this->previousValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,8 +203,8 @@ class Options implements ArrayAccess, Iterator
|
|||||||
*/
|
*/
|
||||||
public function offsetExists($option)
|
public function offsetExists($option)
|
||||||
{
|
{
|
||||||
return isset($this->options[$option]);
|
return isset($this->options[$option]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the value of the given option.
|
* Returns the value of the given option.
|
||||||
@ -220,7 +220,7 @@ class Options implements ArrayAccess, Iterator
|
|||||||
* between two lazy options.
|
* between two lazy options.
|
||||||
*
|
*
|
||||||
* @see ArrayAccess::offsetGet()
|
* @see ArrayAccess::offsetGet()
|
||||||
*/
|
*/
|
||||||
public function offsetGet($option)
|
public function offsetGet($option)
|
||||||
{
|
{
|
||||||
if (!array_key_exists($option, $this->options)) {
|
if (!array_key_exists($option, $this->options)) {
|
||||||
@ -243,8 +243,8 @@ class Options implements ArrayAccess, Iterator
|
|||||||
$this->lock[$option] = false;
|
$this->lock[$option] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->options[$option];
|
return $this->options[$option];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of a given option.
|
* Sets the value of a given option.
|
||||||
@ -259,7 +259,7 @@ class Options implements ArrayAccess, Iterator
|
|||||||
*
|
*
|
||||||
* @see DefaultOptions::add()
|
* @see DefaultOptions::add()
|
||||||
* @see ArrayAccess::offsetSet()
|
* @see ArrayAccess::offsetSet()
|
||||||
*/
|
*/
|
||||||
public function offsetSet($option, $value)
|
public function offsetSet($option, $value)
|
||||||
{
|
{
|
||||||
// Setting is not possible once an option is read, because then lazy
|
// Setting is not possible once an option is read, because then lazy
|
||||||
@ -288,7 +288,7 @@ class Options implements ArrayAccess, Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->options[$option] = $newValue;
|
$this->options[$option] = $newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes an option with the given name.
|
* Removes an option with the given name.
|
||||||
@ -300,7 +300,7 @@ class Options implements ArrayAccess, Iterator
|
|||||||
* becomes immutable.
|
* becomes immutable.
|
||||||
*
|
*
|
||||||
* @see ArrayAccess::offsetUnset()
|
* @see ArrayAccess::offsetUnset()
|
||||||
*/
|
*/
|
||||||
public function offsetUnset($option)
|
public function offsetUnset($option)
|
||||||
{
|
{
|
||||||
if ($this->resolved) {
|
if ($this->resolved) {
|
||||||
@ -308,8 +308,8 @@ class Options implements ArrayAccess, Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
unset($this->options[$option]);
|
unset($this->options[$option]);
|
||||||
unset($this->allowedValues[$option]);
|
unset($this->allowedValues[$option]);
|
||||||
unset($this->lock[$option]);
|
unset($this->lock[$option]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -324,41 +324,41 @@ class Options implements ArrayAccess, Iterator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Iterator::current()
|
* @see Iterator::current()
|
||||||
*/
|
*/
|
||||||
public function current()
|
public function current()
|
||||||
{
|
{
|
||||||
return $this->offsetGet($this->key());
|
return $this->offsetGet($this->key());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Iterator::next()
|
* @see Iterator::next()
|
||||||
*/
|
*/
|
||||||
public function next()
|
public function next()
|
||||||
{
|
{
|
||||||
next($this->options);
|
next($this->options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Iterator::key()
|
* @see Iterator::key()
|
||||||
*/
|
*/
|
||||||
public function key()
|
public function key()
|
||||||
{
|
{
|
||||||
return key($this->options);
|
return key($this->options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Iterator::valid()
|
* @see Iterator::valid()
|
||||||
*/
|
*/
|
||||||
public function valid()
|
public function valid()
|
||||||
{
|
{
|
||||||
return null !== $this->key();
|
return null !== $this->key();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Iterator::rewind()
|
* @see Iterator::rewind()
|
||||||
*/
|
*/
|
||||||
public function rewind()
|
public function rewind()
|
||||||
{
|
{
|
||||||
reset($this->options);
|
reset($this->options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,4 +73,4 @@ class DefaultOptionsTest extends \PHPUnit_Framework_TestCase
|
|||||||
'foo' => 'bam',
|
'foo' => 'bam',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Form\Tests\Extension\Core\EventListener;
|
namespace Symfony\Component\Form\Tests\Extension\Core\EventListener;
|
||||||
|
|
||||||
use Symfony\Component\Form\Tests\Fixtures\CustomArrayObject;
|
use Symfony\Component\Form\Tests\Fixtures\CustomArrayObject;
|
||||||
|
|
||||||
class MergeCollectionListenerCustomArrayObjectTest extends MergeCollectionListenerTest
|
class MergeCollectionListenerCustomArrayObjectTest extends MergeCollectionListenerTest
|
||||||
{
|
{
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Form\Tests\Fixtures;
|
namespace Symfony\Component\Form\Tests\Fixtures;
|
||||||
|
|
||||||
use Symfony\Component\Form\FormInterface;
|
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\FormBuilder;
|
use Symfony\Component\Form\FormBuilder;
|
||||||
|
|
||||||
|
@ -11,60 +11,60 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Form\Tests\Fixtures;
|
namespace Symfony\Component\Form\Tests\Fixtures;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is a hand written simplified version of PHP native `ArrayObject`
|
* This class is a hand written simplified version of PHP native `ArrayObject`
|
||||||
* class, to show that it behaves differently than the PHP native implementation.
|
* class, to show that it behaves differently than the PHP native implementation.
|
||||||
*/
|
*/
|
||||||
class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable
|
class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable
|
||||||
{
|
{
|
||||||
private $array;
|
private $array;
|
||||||
|
|
||||||
public function __construct(array $array = null)
|
public function __construct(array $array = null)
|
||||||
{
|
{
|
||||||
$this->array = $array ?: array();
|
$this->array = $array ?: array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetExists($offset)
|
public function offsetExists($offset)
|
||||||
{
|
{
|
||||||
return array_key_exists($offset, $this->array);
|
return array_key_exists($offset, $this->array);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset)
|
||||||
{
|
{
|
||||||
return $this->array[$offset];
|
return $this->array[$offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
if (null === $offset) {
|
if (null === $offset) {
|
||||||
$this->array[] = $value;
|
$this->array[] = $value;
|
||||||
} else {
|
} else {
|
||||||
$this->array[$offset] = $value;
|
$this->array[$offset] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset)
|
||||||
{
|
{
|
||||||
unset($this->array[$offset]);
|
unset($this->array[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return new \ArrayIterator($this->array);
|
return new \ArrayIterator($this->array);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function count()
|
public function count()
|
||||||
{
|
{
|
||||||
return count($this->array);
|
return count($this->array);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function serialize()
|
public function serialize()
|
||||||
{
|
{
|
||||||
return serialize($this->array);
|
return serialize($this->array);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unserialize($serialized)
|
public function unserialize($serialized)
|
||||||
{
|
{
|
||||||
$this->array = (array) unserialize((string) $serialized);
|
$this->array = (array) unserialize((string) $serialized);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,9 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertFalse(isset($this->options['bar']));
|
$this->assertFalse(isset($this->options['bar']));
|
||||||
$this->assertEquals(0, $this->options['foo']);
|
$this->assertEquals(0, $this->options['foo']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \OutOfBoundsException
|
* @expectedException \OutOfBoundsException
|
||||||
*/
|
*/
|
||||||
public function testGetNonExisting()
|
public function testGetNonExisting()
|
||||||
{
|
{
|
||||||
@ -165,4 +165,4 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->options['foo'];
|
$this->options['foo'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,7 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
|
|||||||
if (!$this->memcache->replace($this->prefix.$sessionId, $data, 0, $this->memcacheOptions['expiretime'])) {
|
if (!$this->memcache->replace($this->prefix.$sessionId, $data, 0, $this->memcacheOptions['expiretime'])) {
|
||||||
return $this->memcache->set($this->prefix.$sessionId, $data, 0, $this->memcacheOptions['expiretime']);
|
return $this->memcache->set($this->prefix.$sessionId, $data, 0, $this->memcacheOptions['expiretime']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,4 +142,4 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
|||||||
|
|
||||||
return $this->collection;
|
return $this->collection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1053,7 +1053,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('fo%2Bo/bar', 'fo+o', 'fo%2Bo'),
|
array('fo%2Bo/bar', 'fo+o', 'fo%2Bo'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function stopTrustingProxyData()
|
private function stopTrustingProxyData()
|
||||||
{
|
{
|
||||||
$class = new \ReflectionClass('Symfony\\Component\\HttpFoundation\\Request');
|
$class = new \ReflectionClass('Symfony\\Component\\HttpFoundation\\Request');
|
||||||
|
@ -96,4 +96,4 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(0, $coll->count());
|
$this->assertEquals(0, $coll->count());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,10 @@ class MemcacheMock
|
|||||||
{
|
{
|
||||||
if ('127.0.0.1' == $host && 11211 == $port) {
|
if ('127.0.0.1' == $host && 11211 == $port) {
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,8 +60,10 @@ class MemcacheMock
|
|||||||
{
|
{
|
||||||
if ('127.0.0.1' == $host && 11211 == $port) {
|
if ('127.0.0.1' == $host && 11211 == $port) {
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,8 +86,10 @@ class MemcacheMock
|
|||||||
{
|
{
|
||||||
if ('127.0.0.1' == $host && 11211 == $port) {
|
if ('127.0.0.1' == $host && 11211 == $port) {
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,8 +111,10 @@ class MemcacheMock
|
|||||||
|
|
||||||
if (!isset($this->storage[$key])) {
|
if (!isset($this->storage[$key])) {
|
||||||
$this->storeData($key, $var);
|
$this->storeData($key, $var);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,6 +135,7 @@ class MemcacheMock
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->storeData($key, $var);
|
$this->storeData($key, $var);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,8 +157,10 @@ class MemcacheMock
|
|||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
$this->storeData($key, $var);
|
$this->storeData($key, $var);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,6 +185,7 @@ class MemcacheMock
|
|||||||
$result[] = $this->getData($k);
|
$result[] = $this->getData($k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +207,10 @@ class MemcacheMock
|
|||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
unset($this->storage[$key]);
|
unset($this->storage[$key]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,6 +226,7 @@ class MemcacheMock
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->storage = array();
|
$this->storage = array();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,6 +238,7 @@ class MemcacheMock
|
|||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
$this->connected = false;
|
$this->connected = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,12 +247,14 @@ class MemcacheMock
|
|||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
return unserialize($this->storage[$key]);
|
return unserialize($this->storage[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function storeData($key, $value)
|
private function storeData($key, $value)
|
||||||
{
|
{
|
||||||
$this->storage[$key] = serialize($value);
|
$this->storage[$key] = serialize($value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,10 @@ class MemcachedMock
|
|||||||
{
|
{
|
||||||
if ('127.0.0.1' == $host && 11211 == $port) {
|
if ('127.0.0.1' == $host && 11211 == $port) {
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,8 +77,10 @@ class MemcachedMock
|
|||||||
|
|
||||||
if (!isset($this->storage[$key])) {
|
if (!isset($this->storage[$key])) {
|
||||||
$this->storeData($key, $value);
|
$this->storeData($key, $value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +100,7 @@ class MemcachedMock
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->storeData($key, $value);
|
$this->storeData($key, $value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,8 +121,10 @@ class MemcachedMock
|
|||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
$this->storeData($key, $value);
|
$this->storeData($key, $value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,8 +162,10 @@ class MemcachedMock
|
|||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
$this->storeData($key, $this->getData($key).$value);
|
$this->storeData($key, $this->getData($key).$value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,8 +184,10 @@ class MemcachedMock
|
|||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
unset($this->storage[$key]);
|
unset($this->storage[$key]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,6 +203,7 @@ class MemcachedMock
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->storage = array();
|
$this->storage = array();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,12 +212,14 @@ class MemcachedMock
|
|||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
return unserialize($this->storage[$key]);
|
return unserialize($this->storage[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function storeData($key, $value)
|
private function storeData($key, $value)
|
||||||
{
|
{
|
||||||
$this->storage[$key] = serialize($value);
|
$this->storage[$key] = serialize($value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,8 +41,10 @@ class RedisMock
|
|||||||
{
|
{
|
||||||
if ('127.0.0.1' == $host && 6379 == $port) {
|
if ('127.0.0.1' == $host && 6379 == $port) {
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +97,7 @@ class RedisMock
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->storeData($key, $value);
|
$this->storeData($key, $value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,6 +118,7 @@ class RedisMock
|
|||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,8 +154,10 @@ class RedisMock
|
|||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
$this->storeData($key, $this->getData($key).$value);
|
$this->storeData($key, $this->getData($key).$value);
|
||||||
|
|
||||||
return strlen($this->storage[$key]);
|
return strlen($this->storage[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,13 +182,16 @@ class RedisMock
|
|||||||
++$result;
|
++$result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
unset($this->storage[$key]);
|
unset($this->storage[$key]);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +207,7 @@ class RedisMock
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->storage = array();
|
$this->storage = array();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,6 +219,7 @@ class RedisMock
|
|||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
$this->connected = false;
|
$this->connected = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,12 +228,14 @@ class RedisMock
|
|||||||
if (isset($this->storage[$key])) {
|
if (isset($this->storage[$key])) {
|
||||||
return unserialize($this->storage[$key]);
|
return unserialize($this->storage[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function storeData($key, $value)
|
private function storeData($key, $value)
|
||||||
{
|
{
|
||||||
$this->storage[$key] = serialize($value);
|
$this->storage[$key] = serialize($value);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,6 +231,7 @@ EOF;
|
|||||||
goto $gotoname;
|
goto $gotoname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOF;
|
EOF;
|
||||||
} else {
|
} else {
|
||||||
$methods = implode("', '", $methods);
|
$methods = implode("', '", $methods);
|
||||||
@ -240,6 +241,7 @@ EOF;
|
|||||||
goto $gotoname;
|
goto $gotoname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOF;
|
EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -250,6 +252,7 @@ EOF;
|
|||||||
return \$this->redirect(\$pathinfo.'/', '$name');
|
return \$this->redirect(\$pathinfo.'/', '$name');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOF;
|
EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,6 +266,7 @@ EOF;
|
|||||||
return \$this->redirect(\$pathinfo, '$name', '$scheme');
|
return \$this->redirect(\$pathinfo, '$name', '$scheme');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EOF;
|
EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +275,7 @@ EOF;
|
|||||||
$code .= sprintf(" return array_merge(\$this->mergeDefaults(\$matches, %s), array('_route' => '%s'));\n"
|
$code .= sprintf(" return array_merge(\$this->mergeDefaults(\$matches, %s), array('_route' => '%s'));\n"
|
||||||
, str_replace("\n", '', var_export($compiledRoute->getDefaults(), true)), $name);
|
, str_replace("\n", '', var_export($compiledRoute->getDefaults(), true)), $name);
|
||||||
} elseif (true === $matches) {
|
} elseif (true === $matches) {
|
||||||
$code .= sprintf(" \$matches['_route'] = '%s';\n", $name);
|
$code .= sprintf(" \$matches['_route'] = '%s';\n\n", $name);
|
||||||
$code .= " return \$matches;\n";
|
$code .= " return \$matches;\n";
|
||||||
} elseif ($compiledRoute->getDefaults()) {
|
} elseif ($compiledRoute->getDefaults()) {
|
||||||
$code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_merge($compiledRoute->getDefaults(), array('_route' => $name)), true)));
|
$code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_merge($compiledRoute->getDefaults(), array('_route' => $name)), true)));
|
||||||
|
@ -36,7 +36,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$allow = array_merge($allow, array('GET', 'HEAD'));
|
$allow = array_merge($allow, array('GET', 'HEAD'));
|
||||||
goto not_bar;
|
goto not_bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'bar';
|
$matches['_route'] = 'bar';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_bar:
|
not_bar:
|
||||||
@ -47,7 +49,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$allow = array_merge($allow, array('GET', 'HEAD'));
|
$allow = array_merge($allow, array('GET', 'HEAD'));
|
||||||
goto not_barhead;
|
goto not_barhead;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'barhead';
|
$matches['_route'] = 'barhead';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_barhead:
|
not_barhead:
|
||||||
@ -70,6 +74,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// baz4
|
// baz4
|
||||||
if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) {
|
if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?<foo>[^/]+?)/$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'baz4';
|
$matches['_route'] = 'baz4';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +84,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$allow[] = 'POST';
|
$allow[] = 'POST';
|
||||||
goto not_baz5;
|
goto not_baz5;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'baz5';
|
$matches['_route'] = 'baz5';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_baz5:
|
not_baz5:
|
||||||
@ -90,7 +97,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
$allow[] = 'PUT';
|
$allow[] = 'PUT';
|
||||||
goto not_bazbaz6;
|
goto not_bazbaz6;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'baz.baz6';
|
$matches['_route'] = 'baz.baz6';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_bazbaz6:
|
not_bazbaz6:
|
||||||
@ -103,6 +112,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// quoter
|
// quoter
|
||||||
if (preg_match('#^/(?<quoter>[\']+)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/(?<quoter>[\']+)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'quoter';
|
$matches['_route'] = 'quoter';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,12 +126,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// foo1
|
// foo1
|
||||||
if (preg_match('#^/a/b\'b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo1';
|
$matches['_route'] = 'foo1';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bar1
|
// bar1
|
||||||
if (preg_match('#^/a/b\'b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'bar1';
|
$matches['_route'] = 'bar1';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,6 +142,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// overriden
|
// overriden
|
||||||
if (preg_match('#^/a/(?<var>.*)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/(?<var>.*)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'overriden';
|
$matches['_route'] = 'overriden';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,12 +150,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// foo2
|
// foo2
|
||||||
if (preg_match('#^/a/b\'b/(?<foo1>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<foo1>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo2';
|
$matches['_route'] = 'foo2';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bar2
|
// bar2
|
||||||
if (preg_match('#^/a/b\'b/(?<bar1>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<bar1>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'bar2';
|
$matches['_route'] = 'bar2';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,12 +186,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// foo3
|
// foo3
|
||||||
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo3';
|
$matches['_route'] = 'foo3';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bar3
|
// bar3
|
||||||
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'bar3';
|
$matches['_route'] = 'bar3';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,6 +205,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// foo4
|
// foo4
|
||||||
if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo4';
|
$matches['_route'] = 'foo4';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,12 +219,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// b
|
// b
|
||||||
if (preg_match('#^/a/b/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'b';
|
$matches['_route'] = 'b';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// c
|
// c
|
||||||
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'c';
|
$matches['_route'] = 'c';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$allow = array_merge($allow, array('GET', 'HEAD'));
|
$allow = array_merge($allow, array('GET', 'HEAD'));
|
||||||
goto not_bar;
|
goto not_bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'bar';
|
$matches['_route'] = 'bar';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_bar:
|
not_bar:
|
||||||
@ -47,7 +49,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$allow = array_merge($allow, array('GET', 'HEAD'));
|
$allow = array_merge($allow, array('GET', 'HEAD'));
|
||||||
goto not_barhead;
|
goto not_barhead;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'barhead';
|
$matches['_route'] = 'barhead';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_barhead:
|
not_barhead:
|
||||||
@ -67,6 +71,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if (substr($pathinfo, -1) !== '/') {
|
if (substr($pathinfo, -1) !== '/') {
|
||||||
return $this->redirect($pathinfo.'/', 'baz3');
|
return $this->redirect($pathinfo.'/', 'baz3');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('_route' => 'baz3');
|
return array('_route' => 'baz3');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +80,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if (substr($pathinfo, -1) !== '/') {
|
if (substr($pathinfo, -1) !== '/') {
|
||||||
return $this->redirect($pathinfo.'/', 'baz4');
|
return $this->redirect($pathinfo.'/', 'baz4');
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'baz4';
|
$matches['_route'] = 'baz4';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +92,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$allow[] = 'POST';
|
$allow[] = 'POST';
|
||||||
goto not_baz5;
|
goto not_baz5;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'baz5';
|
$matches['_route'] = 'baz5';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_baz5:
|
not_baz5:
|
||||||
@ -96,7 +105,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
$allow[] = 'PUT';
|
$allow[] = 'PUT';
|
||||||
goto not_bazbaz6;
|
goto not_bazbaz6;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches['_route'] = 'baz.baz6';
|
$matches['_route'] = 'baz.baz6';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
not_bazbaz6:
|
not_bazbaz6:
|
||||||
@ -109,6 +120,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// quoter
|
// quoter
|
||||||
if (preg_match('#^/(?<quoter>[\']+)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/(?<quoter>[\']+)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'quoter';
|
$matches['_route'] = 'quoter';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,12 +134,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// foo1
|
// foo1
|
||||||
if (preg_match('#^/a/b\'b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo1';
|
$matches['_route'] = 'foo1';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bar1
|
// bar1
|
||||||
if (preg_match('#^/a/b\'b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'bar1';
|
$matches['_route'] = 'bar1';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +150,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// overriden
|
// overriden
|
||||||
if (preg_match('#^/a/(?<var>.*)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/(?<var>.*)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'overriden';
|
$matches['_route'] = 'overriden';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,12 +158,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// foo2
|
// foo2
|
||||||
if (preg_match('#^/a/b\'b/(?<foo1>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<foo1>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo2';
|
$matches['_route'] = 'foo2';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bar2
|
// bar2
|
||||||
if (preg_match('#^/a/b\'b/(?<bar1>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b\'b/(?<bar1>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'bar2';
|
$matches['_route'] = 'bar2';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +189,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if (substr($pathinfo, -1) !== '/') {
|
if (substr($pathinfo, -1) !== '/') {
|
||||||
return $this->redirect($pathinfo.'/', 'hey');
|
return $this->redirect($pathinfo.'/', 'hey');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('_route' => 'hey');
|
return array('_route' => 'hey');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,12 +198,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// foo3
|
// foo3
|
||||||
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo3';
|
$matches['_route'] = 'foo3';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bar3
|
// bar3
|
||||||
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/(?<_locale>[^/]+?)/b/(?<bar>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'bar3';
|
$matches['_route'] = 'bar3';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +217,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// foo4
|
// foo4
|
||||||
if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (0 === strpos($pathinfo, '/aba') && preg_match('#^/aba/(?<foo>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'foo4';
|
$matches['_route'] = 'foo4';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,12 +231,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
// b
|
// b
|
||||||
if (preg_match('#^/a/b/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/a/b/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'b';
|
$matches['_route'] = 'b';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// c
|
// c
|
||||||
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'c';
|
$matches['_route'] = 'c';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,6 +251,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if ($this->context->getScheme() !== 'https') {
|
if ($this->context->getScheme() !== 'https') {
|
||||||
return $this->redirect($pathinfo, 'secure', 'https');
|
return $this->redirect($pathinfo, 'secure', 'https');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('_route' => 'secure');
|
return array('_route' => 'secure');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,6 +260,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
|||||||
if ($this->context->getScheme() !== 'http') {
|
if ($this->context->getScheme() !== 'http') {
|
||||||
return $this->redirect($pathinfo, 'nonsecure', 'http');
|
return $this->redirect($pathinfo, 'nonsecure', 'http');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('_route' => 'nonsecure');
|
return array('_route' => 'nonsecure');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|||||||
// dynamic
|
// dynamic
|
||||||
if (preg_match('#^/rootprefix/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
if (preg_match('#^/rootprefix/(?<var>[^/]+?)$#s', $pathinfo, $matches)) {
|
||||||
$matches['_route'] = 'dynamic';
|
$matches['_route'] = 'dynamic';
|
||||||
|
|
||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,13 +12,13 @@
|
|||||||
namespace Symfony\Component\Security\Tests\Acl\Domain
|
namespace Symfony\Component\Security\Tests\Acl\Domain
|
||||||
{
|
{
|
||||||
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
|
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
|
||||||
|
|
||||||
class ObjectIdentityTest extends \PHPUnit_Framework_TestCase
|
class ObjectIdentityTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testConstructor()
|
public function testConstructor()
|
||||||
{
|
{
|
||||||
$id = new ObjectIdentity('fooid', 'footype');
|
$id = new ObjectIdentity('fooid', 'footype');
|
||||||
|
|
||||||
$this->assertEquals('fooid', $id->getIdentifier());
|
$this->assertEquals('fooid', $id->getIdentifier());
|
||||||
$this->assertEquals('footype', $id->getType());
|
$this->assertEquals('footype', $id->getType());
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ namespace Symfony\Component\Security\Tests\Acl\Domain
|
|||||||
$this->assertEquals('fooid', $id->getIdentifier());
|
$this->assertEquals('fooid', $id->getIdentifier());
|
||||||
$this->assertEquals('Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Tests\Acl\Domain\TestDomainObject', $id->getType());
|
$this->assertEquals('Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Tests\Acl\Domain\TestDomainObject', $id->getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFromDomainObjectPrefersInterfaceOverGetId()
|
public function testFromDomainObjectPrefersInterfaceOverGetId()
|
||||||
{
|
{
|
||||||
$domainObject = $this->getMock('Symfony\Component\Security\Acl\Model\DomainObjectInterface');
|
$domainObject = $this->getMock('Symfony\Component\Security\Acl\Model\DomainObjectInterface');
|
||||||
@ -45,11 +45,11 @@ namespace Symfony\Component\Security\Tests\Acl\Domain
|
|||||||
->method('getId')
|
->method('getId')
|
||||||
->will($this->returnValue('getId()'))
|
->will($this->returnValue('getId()'))
|
||||||
;
|
;
|
||||||
|
|
||||||
$id = ObjectIdentity::fromDomainObject($domainObject);
|
$id = ObjectIdentity::fromDomainObject($domainObject);
|
||||||
$this->assertEquals('getObjectIdentifier()', $id->getIdentifier());
|
$this->assertEquals('getObjectIdentifier()', $id->getIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFromDomainObjectWithoutInterface()
|
public function testFromDomainObjectWithoutInterface()
|
||||||
{
|
{
|
||||||
$id = ObjectIdentity::fromDomainObject(new TestDomainObject());
|
$id = ObjectIdentity::fromDomainObject(new TestDomainObject());
|
||||||
@ -63,7 +63,7 @@ namespace Symfony\Component\Security\Tests\Acl\Domain
|
|||||||
$this->assertEquals('getId()', $id->getIdentifier());
|
$this->assertEquals('getId()', $id->getIdentifier());
|
||||||
$this->assertEquals('Symfony\Component\Security\Tests\Acl\Domain\TestDomainObject', $id->getType());
|
$this->assertEquals('Symfony\Component\Security\Tests\Acl\Domain\TestDomainObject', $id->getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getCompareData
|
* @dataProvider getCompareData
|
||||||
*/
|
*/
|
||||||
@ -75,7 +75,7 @@ namespace Symfony\Component\Security\Tests\Acl\Domain
|
|||||||
$this->assertFalse($oid1->equals($oid2));
|
$this->assertFalse($oid1->equals($oid2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompareData()
|
public function getCompareData()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
@ -85,7 +85,7 @@ namespace Symfony\Component\Security\Tests\Acl\Domain
|
|||||||
array(new ObjectIdentity('1', 'bla'), new ObjectIdentity('1', 'blub'), false),
|
array(new ObjectIdentity('1', 'bla'), new ObjectIdentity('1', 'blub'), false),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
if (!class_exists('Doctrine\DBAL\DriverManager')) {
|
if (!class_exists('Doctrine\DBAL\DriverManager')) {
|
||||||
@ -93,14 +93,14 @@ namespace Symfony\Component\Security\Tests\Acl\Domain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestDomainObject
|
class TestDomainObject
|
||||||
{
|
{
|
||||||
public function getObjectIdentifier()
|
public function getObjectIdentifier()
|
||||||
{
|
{
|
||||||
return 'getObjectIdentifier()';
|
return 'getObjectIdentifier()';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return 'getId()';
|
return 'getId()';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
namespace Symfony\Component\Security\Tests\Core\Util
|
namespace Symfony\Component\Security\Tests\Core\Util
|
||||||
{
|
{
|
||||||
use Symfony\Component\Security\Core\Util\ClassUtils;
|
use Symfony\Component\Security\Core\Util\ClassUtils;
|
||||||
|
|
||||||
class ClassUtilsTest extends \PHPUnit_Framework_TestCase
|
class ClassUtilsTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
static public function dataGetClass()
|
static public function dataGetClass()
|
||||||
@ -18,7 +18,7 @@ namespace Symfony\Component\Security\Tests\Core\Util
|
|||||||
array(new \Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Tests\Core\Util\TestObject(), 'Symfony\Component\Security\Tests\Core\Util\TestObject'),
|
array(new \Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Tests\Core\Util\TestObject(), 'Symfony\Component\Security\Tests\Core\Util\TestObject'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider dataGetClass
|
* @dataProvider dataGetClass
|
||||||
*/
|
*/
|
||||||
|
@ -134,6 +134,7 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||||||
foreach ($bars as $bar) {
|
foreach ($bars as $bar) {
|
||||||
$foos .= $bar->getFoo();
|
$foos .= $bar->getFoo();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $foos;
|
return $foos;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -54,7 +54,7 @@ class EmailValidator extends ConstraintValidator
|
|||||||
// Check for host DNS resource records
|
// Check for host DNS resource records
|
||||||
if ($valid && $constraint->checkMX) {
|
if ($valid && $constraint->checkMX) {
|
||||||
$valid = $this->checkMX($host);
|
$valid = $this->checkMX($host);
|
||||||
} else if ($valid && $constraint->checkHost) {
|
} elseif ($valid && $constraint->checkHost) {
|
||||||
$valid = $this->checkHost($host);
|
$valid = $this->checkHost($host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,12 +75,12 @@ class EmailValidator extends ConstraintValidator
|
|||||||
{
|
{
|
||||||
return checkdnsrr($host, 'MX');
|
return checkdnsrr($host, 'MX');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if one of MX, A or AAAA DNS RR exists.
|
* Check if one of MX, A or AAAA DNS RR exists.
|
||||||
*
|
*
|
||||||
* @param string $host Hostname
|
* @param string $host Hostname
|
||||||
*
|
*
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
private function checkHost($host)
|
private function checkHost($host)
|
||||||
|
@ -56,7 +56,7 @@ class ExecutionContext
|
|||||||
* @param string $message The error message.
|
* @param string $message The error message.
|
||||||
* @param array $params The parameters parsed into the error message.
|
* @param array $params The parameters parsed into the error message.
|
||||||
* @param mixed $invalidValue The invalid, validated value.
|
* @param mixed $invalidValue The invalid, validated value.
|
||||||
* @param integer|null $pluralization The number to use to pluralize of the message.
|
* @param integer|null $pluralization The number to use to pluralize of the message.
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@ -81,7 +81,7 @@ class ExecutionContext
|
|||||||
* @param string $message The error message.
|
* @param string $message The error message.
|
||||||
* @param array $params The parameters parsed into the error message.
|
* @param array $params The parameters parsed into the error message.
|
||||||
* @param mixed $invalidValue The invalid, validated value.
|
* @param mixed $invalidValue The invalid, validated value.
|
||||||
* @param integer|null $pluralization The number to use to pluralize of the message.
|
* @param integer|null $pluralization The number to use to pluralize of the message.
|
||||||
*/
|
*/
|
||||||
public function addViolationAtPath($propertyPath, $message, array $params = array(), $invalidValue = null, $pluralization = null)
|
public function addViolationAtPath($propertyPath, $message, array $params = array(), $invalidValue = null, $pluralization = null)
|
||||||
{
|
{
|
||||||
@ -104,7 +104,7 @@ class ExecutionContext
|
|||||||
* @param string $message The error message.
|
* @param string $message The error message.
|
||||||
* @param array $params The parameters parsed into the error message.
|
* @param array $params The parameters parsed into the error message.
|
||||||
* @param mixed $invalidValue The invalid, validated value.
|
* @param mixed $invalidValue The invalid, validated value.
|
||||||
* @param integer|null $pluralization The number to use to pluralize of the message.
|
* @param integer|null $pluralization The number to use to pluralize of the message.
|
||||||
*/
|
*/
|
||||||
public function addViolationAtSubPath($subPath, $message, array $params = array(), $invalidValue = null, $pluralization = null)
|
public function addViolationAtSubPath($subPath, $message, array $params = array(), $invalidValue = null, $pluralization = null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user