Merge branch '2.3' into 2.4
* 2.3: Fixed relative redirects for ambiguous paths [BrowserKit] Fix browser kit redirect with ports [TwigBridge] [Form] Fixed some extra empty spaces Plural fix removed some .gitattributes that should have been removed a lot time ago [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output fixed whitespace in Twig form template built-in server: exit when docroot does not exist Conflicts: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
This commit is contained in:
commit
6f56ea423d
@ -54,7 +54,7 @@
|
|||||||
{% block choice_widget_collapsed -%}
|
{% block choice_widget_collapsed -%}
|
||||||
{% if required and empty_value is none and not empty_value_in_choices and not multiple -%}
|
{% if required and empty_value is none and not empty_value_in_choices and not multiple -%}
|
||||||
{% set required = false %}
|
{% set required = false %}
|
||||||
{% endif %}
|
{%- endif -%}
|
||||||
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
||||||
{% if empty_value is not none -%}
|
{% if empty_value is not none -%}
|
||||||
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ empty_value|trans({}, translation_domain) }}</option>
|
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ empty_value|trans({}, translation_domain) }}</option>
|
||||||
|
@ -81,6 +81,14 @@ EOF
|
|||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
$documentRoot = $input->getOption('docroot');
|
||||||
|
|
||||||
|
if (!is_dir($documentRoot)) {
|
||||||
|
$output->writeln(sprintf('<error>The given document root directory "%s" does not exist</error>', $documentRoot));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
$env = $this->getContainer()->getParameter('kernel.environment');
|
$env = $this->getContainer()->getParameter('kernel.environment');
|
||||||
|
|
||||||
if ('prod' === $env) {
|
if ('prod' === $env) {
|
||||||
@ -96,7 +104,7 @@ EOF
|
|||||||
$output->writeln(sprintf("Server running on <info>http://%s</info>\n", $input->getArgument('address')));
|
$output->writeln(sprintf("Server running on <info>http://%s</info>\n", $input->getArgument('address')));
|
||||||
|
|
||||||
$builder = new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router));
|
$builder = new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router));
|
||||||
$builder->setWorkingDirectory($input->getOption('docroot'));
|
$builder->setWorkingDirectory($documentRoot);
|
||||||
$builder->setTimeout(null);
|
$builder->setTimeout(null);
|
||||||
$builder->getProcess()->run(function ($type, $buffer) use ($output) {
|
$builder->getProcess()->run(function ($type, $buffer) use ($output) {
|
||||||
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
|
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
|
||||||
|
@ -298,7 +298,7 @@ abstract class Client
|
|||||||
|
|
||||||
$uri = $this->getAbsoluteUri($uri);
|
$uri = $this->getAbsoluteUri($uri);
|
||||||
|
|
||||||
if (isset($server['HTTP_HOST'])) {
|
if (!empty($server['HTTP_HOST'])) {
|
||||||
$uri = preg_replace('{^(https?\://)'.preg_quote($this->extractHost($uri)).'}', '${1}'.$server['HTTP_HOST'], $uri);
|
$uri = preg_replace('{^(https?\://)'.preg_quote($this->extractHost($uri)).'}', '${1}'.$server['HTTP_HOST'], $uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,7 +602,7 @@ abstract class Client
|
|||||||
|
|
||||||
private function updateServerFromUri($server, $uri)
|
private function updateServerFromUri($server, $uri)
|
||||||
{
|
{
|
||||||
$server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST);
|
$server['HTTP_HOST'] = $this->extractHost($uri);
|
||||||
$scheme = parse_url($uri, PHP_URL_SCHEME);
|
$scheme = parse_url($uri, PHP_URL_SCHEME);
|
||||||
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' == $scheme;
|
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' == $scheme;
|
||||||
unset($server['HTTP_IF_NONE_MATCH'], $server['HTTP_IF_MODIFIED_SINCE']);
|
unset($server['HTTP_IF_NONE_MATCH'], $server['HTTP_IF_MODIFIED_SINCE']);
|
||||||
|
@ -367,6 +367,19 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testFollowRelativeRedirect()
|
||||||
|
{
|
||||||
|
$client = new TestClient();
|
||||||
|
$client->setNextResponse(new Response('', 302, array('Location' => '/redirected')));
|
||||||
|
$client->request('GET', 'http://www.example.com/foo/foobar');
|
||||||
|
$this->assertEquals('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect if any');
|
||||||
|
|
||||||
|
$client = new TestClient();
|
||||||
|
$client->setNextResponse(new Response('', 302, array('Location' => '/redirected:1234')));
|
||||||
|
$client->request('GET', 'http://www.example.com/foo/foobar');
|
||||||
|
$this->assertEquals('http://www.example.com/redirected:1234', $client->getRequest()->getUri(), '->followRedirect() follows relative urls');
|
||||||
|
}
|
||||||
|
|
||||||
public function testFollowRedirectWithMaxRedirects()
|
public function testFollowRedirectWithMaxRedirects()
|
||||||
{
|
{
|
||||||
$client = new TestClient();
|
$client = new TestClient();
|
||||||
@ -452,11 +465,11 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||||||
$headers = array(
|
$headers = array(
|
||||||
'HTTP_HOST' => 'www.example.com:8080',
|
'HTTP_HOST' => 'www.example.com:8080',
|
||||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||||
'HTTPS' => false
|
'HTTPS' => false,
|
||||||
|
'HTTP_REFERER' => 'http://www.example.com:8080/'
|
||||||
);
|
);
|
||||||
|
|
||||||
$client = new TestClient();
|
$client = new TestClient();
|
||||||
$client->followRedirects(false);
|
|
||||||
$client->setNextResponse(new Response('', 302, array(
|
$client->setNextResponse(new Response('', 302, array(
|
||||||
'Location' => 'http://www.example.com:8080/redirected',
|
'Location' => 'http://www.example.com:8080/redirected',
|
||||||
)));
|
)));
|
||||||
|
@ -120,6 +120,9 @@ class XmlDumper extends Dumper
|
|||||||
if ($definition->getFactoryMethod()) {
|
if ($definition->getFactoryMethod()) {
|
||||||
$service->setAttribute('factory-method', $definition->getFactoryMethod());
|
$service->setAttribute('factory-method', $definition->getFactoryMethod());
|
||||||
}
|
}
|
||||||
|
if ($definition->getFactoryClass()) {
|
||||||
|
$service->setAttribute('factory-class', $definition->getFactoryClass());
|
||||||
|
}
|
||||||
if ($definition->getFactoryService()) {
|
if ($definition->getFactoryService()) {
|
||||||
$service->setAttribute('factory-service', $definition->getFactoryService());
|
$service->setAttribute('factory-service', $definition->getFactoryService());
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parameter key="foo">bar</parameter>
|
<parameter key="foo">bar</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
<services>
|
<services>
|
||||||
<service id="foo" class="FooClass" factory-method="getInstance">
|
<service id="foo" class="FooClass" factory-method="getInstance" factory-class="FooClass">
|
||||||
<tag name="foo" foo="foo"/>
|
<tag name="foo" foo="foo"/>
|
||||||
<tag name="foo" bar="bar"/>
|
<tag name="foo" bar="bar"/>
|
||||||
<argument>foo</argument>
|
<argument>foo</argument>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<argument>%foo_bar%</argument>
|
<argument>%foo_bar%</argument>
|
||||||
<configurator service="foo.baz" method="configure"/>
|
<configurator service="foo.baz" method="configure"/>
|
||||||
</service>
|
</service>
|
||||||
<service id="foo.baz" class="%baz_class%" factory-method="getInstance">
|
<service id="foo.baz" class="%baz_class%" factory-method="getInstance" factory-class="%baz_class%">
|
||||||
<configurator class="%baz_class%" method="configureStatic1"/>
|
<configurator class="%baz_class%" method="configureStatic1"/>
|
||||||
</service>
|
</service>
|
||||||
<service id="foo_bar" class="%foo_class%" scope="prototype"/>
|
<service id="foo_bar" class="%foo_class%" scope="prototype"/>
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
/Tests export-ignore
|
|
||||||
phpunit.xml.dist export-ignore
|
|
@ -75,6 +75,9 @@ class StringUtil
|
|||||||
// objectives (objective), alternative (alternatives)
|
// objectives (objective), alternative (alternatives)
|
||||||
array('sevit', 5, true, true, 'tive'),
|
array('sevit', 5, true, true, 'tive'),
|
||||||
|
|
||||||
|
// drives (drive)
|
||||||
|
array('sevird', 6, false, true, 'drive'),
|
||||||
|
|
||||||
// lives (life), wives (wife)
|
// lives (life), wives (wife)
|
||||||
array('sevi', 4, false, true, 'ife'),
|
array('sevi', 4, false, true, 'ife'),
|
||||||
|
|
||||||
|
@ -20,114 +20,127 @@ class StringUtilTest extends \PHPUnit_Framework_TestCase
|
|||||||
// see http://english-zone.com/spelling/plurals.html
|
// see http://english-zone.com/spelling/plurals.html
|
||||||
// see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English
|
// see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English
|
||||||
return array(
|
return array(
|
||||||
array('tags', 'tag'),
|
array('accesses', 'access'),
|
||||||
|
array('addresses', 'address'),
|
||||||
|
array('agendas', 'agenda'),
|
||||||
|
array('alumnae', 'alumna'),
|
||||||
array('alumni', 'alumnus'),
|
array('alumni', 'alumnus'),
|
||||||
array('funguses', array('fungus', 'funguse', 'fungusis')),
|
|
||||||
array('fungi', 'fungus'),
|
|
||||||
array('axes', array('ax', 'axe', 'axis')),
|
|
||||||
array('appendices', array('appendex', 'appendix', 'appendice')),
|
|
||||||
array('indices', array('index', 'indix', 'indice')),
|
|
||||||
array('prices', array('prex', 'prix', 'price')),
|
|
||||||
array('indexes', 'index'),
|
|
||||||
array('children', 'child'),
|
|
||||||
array('men', 'man'),
|
|
||||||
array('women', 'woman'),
|
|
||||||
array('oxen', 'ox'),
|
|
||||||
array('bacteria', array('bacterion', 'bacterium')),
|
|
||||||
array('criteria', array('criterion', 'criterium')),
|
|
||||||
array('feet', 'foot'),
|
|
||||||
array('nebulae', 'nebula'),
|
|
||||||
array('babies', 'baby'),
|
|
||||||
array('hooves', array('hoof', 'hoove', 'hooff')),
|
|
||||||
array('chateaux', 'chateau'),
|
|
||||||
array('echoes', array('echo', 'echoe')),
|
|
||||||
array('analyses', array('analys', 'analyse', 'analysis')),
|
array('analyses', array('analys', 'analyse', 'analysis')),
|
||||||
array('theses', array('thes', 'these', 'thesis')),
|
|
||||||
array('foci', 'focus'),
|
|
||||||
array('focuses', array('focus', 'focuse', 'focusis')),
|
|
||||||
array('oases', array('oas', 'oase', 'oasis')),
|
|
||||||
array('matrices', array('matrex', 'matrix', 'matrice')),
|
|
||||||
array('matrixes', 'matrix'),
|
|
||||||
array('bureaus', 'bureau'),
|
|
||||||
array('bureaux', 'bureau'),
|
|
||||||
array('beaux', 'beau'),
|
|
||||||
array('data', array('daton', 'datum')),
|
|
||||||
array('phenomena', array('phenomenon', 'phenomenum')),
|
|
||||||
array('strata', array('straton', 'stratum')),
|
|
||||||
array('geese', 'goose'),
|
|
||||||
array('teeth', 'tooth'),
|
|
||||||
array('antennae', 'antenna'),
|
array('antennae', 'antenna'),
|
||||||
array('antennas', 'antenna'),
|
array('antennas', 'antenna'),
|
||||||
array('houses', array('hous', 'house', 'housis')),
|
array('appendices', array('appendex', 'appendix', 'appendice')),
|
||||||
array('arches', array('arch', 'arche')),
|
array('arches', array('arch', 'arche')),
|
||||||
array('atlases', array('atlas', 'atlase', 'atlasis')),
|
array('atlases', array('atlas', 'atlase', 'atlasis')),
|
||||||
|
array('axes', array('ax', 'axe', 'axis')),
|
||||||
|
array('babies', 'baby'),
|
||||||
|
array('bacteria', array('bacterion', 'bacterium')),
|
||||||
|
array('bases', array('bas', 'base', 'basis')),
|
||||||
array('batches', array('batch', 'batche')),
|
array('batches', array('batch', 'batche')),
|
||||||
array('bushes', array('bush', 'bushe')),
|
array('beaux', 'beau'),
|
||||||
|
array('bees', array('be', 'bee')),
|
||||||
|
array('boxes', 'box'),
|
||||||
|
array('boys', 'boy'),
|
||||||
|
array('bureaus', 'bureau'),
|
||||||
|
array('bureaux', 'bureau'),
|
||||||
array('buses', array('bus', 'buse', 'busis')),
|
array('buses', array('bus', 'buse', 'busis')),
|
||||||
|
array('bushes', array('bush', 'bushe')),
|
||||||
array('calves', array('calf', 'calve', 'calff')),
|
array('calves', array('calf', 'calve', 'calff')),
|
||||||
|
array('cars', 'car'),
|
||||||
|
array('cassettes', array('cassett', 'cassette')),
|
||||||
|
array('caves', array('caf', 'cave', 'caff')),
|
||||||
|
array('chateaux', 'chateau'),
|
||||||
|
array('cheeses', array('chees', 'cheese', 'cheesis')),
|
||||||
|
array('children', 'child'),
|
||||||
array('circuses', array('circus', 'circuse', 'circusis')),
|
array('circuses', array('circus', 'circuse', 'circusis')),
|
||||||
|
array('cliffs', 'cliff'),
|
||||||
array('crises', array('cris', 'crise', 'crisis')),
|
array('crises', array('cris', 'crise', 'crisis')),
|
||||||
|
array('criteria', array('criterion', 'criterium')),
|
||||||
|
array('cups', 'cup'),
|
||||||
|
array('data', array('daton', 'datum')),
|
||||||
|
array('days', 'day'),
|
||||||
|
array('discos', 'disco'),
|
||||||
|
array('drives', 'drive'),
|
||||||
|
array('drivers', 'driver'),
|
||||||
array('dwarves', array('dwarf', 'dwarve', 'dwarff')),
|
array('dwarves', array('dwarf', 'dwarve', 'dwarff')),
|
||||||
|
array('echoes', array('echo', 'echoe')),
|
||||||
array('elves', array('elf', 'elve', 'elff')),
|
array('elves', array('elf', 'elve', 'elff')),
|
||||||
array('emphases', array('emphas', 'emphase', 'emphasis')),
|
array('emphases', array('emphas', 'emphase', 'emphasis')),
|
||||||
array('faxes', 'fax'),
|
array('faxes', 'fax'),
|
||||||
|
array('feet', 'foot'),
|
||||||
|
array('foci', 'focus'),
|
||||||
|
array('focuses', array('focus', 'focuse', 'focusis')),
|
||||||
|
array('formulae', 'formula'),
|
||||||
|
array('formulas', 'formula'),
|
||||||
|
array('fungi', 'fungus'),
|
||||||
|
array('funguses', array('fungus', 'funguse', 'fungusis')),
|
||||||
|
array('garages', array('garag', 'garage')),
|
||||||
|
array('geese', 'goose'),
|
||||||
array('halves', array('half', 'halve', 'halff')),
|
array('halves', array('half', 'halve', 'halff')),
|
||||||
|
array('hats', 'hat'),
|
||||||
array('heroes', array('hero', 'heroe')),
|
array('heroes', array('hero', 'heroe')),
|
||||||
|
array('hippopotamuses', array('hippopotamus', 'hippopotamuse', 'hippopotamusis')), //hippopotami
|
||||||
array('hoaxes', 'hoax'),
|
array('hoaxes', 'hoax'),
|
||||||
|
array('hooves', array('hoof', 'hoove', 'hooff')),
|
||||||
|
array('houses', array('hous', 'house', 'housis')),
|
||||||
|
array('indexes', 'index'),
|
||||||
|
array('indices', array('index', 'indix', 'indice')),
|
||||||
|
array('ions', 'ion'),
|
||||||
array('irises', array('iris', 'irise', 'irisis')),
|
array('irises', array('iris', 'irise', 'irisis')),
|
||||||
array('kisses', 'kiss'),
|
array('kisses', 'kiss'),
|
||||||
array('addresses', 'address'),
|
|
||||||
array('accesses', 'access'),
|
|
||||||
array('knives', 'knife'),
|
array('knives', 'knife'),
|
||||||
array('lives', 'life'),
|
array('lamps', 'lamp'),
|
||||||
|
array('leaves', array('leaf', 'leave', 'leaff')),
|
||||||
array('lice', 'louse'),
|
array('lice', 'louse'),
|
||||||
|
array('lives', 'life'),
|
||||||
|
array('matrices', array('matrex', 'matrix', 'matrice')),
|
||||||
|
array('matrixes', 'matrix'),
|
||||||
|
array('men', 'man'),
|
||||||
array('mice', 'mouse'),
|
array('mice', 'mouse'),
|
||||||
|
array('moves', 'move'),
|
||||||
|
array('nebulae', 'nebula'),
|
||||||
array('neuroses', array('neuros', 'neurose', 'neurosis')),
|
array('neuroses', array('neuros', 'neurose', 'neurosis')),
|
||||||
|
array('oases', array('oas', 'oase', 'oasis')),
|
||||||
|
array('objectives', 'objective'),
|
||||||
|
array('oxen', 'ox'),
|
||||||
|
array('parties', 'party'),
|
||||||
|
array('phenomena', array('phenomenon', 'phenomenum')),
|
||||||
|
array('photos', 'photo'),
|
||||||
|
array('pianos', 'piano'),
|
||||||
array('plateaux', 'plateau'),
|
array('plateaux', 'plateau'),
|
||||||
array('poppies', 'poppy'),
|
array('poppies', 'poppy'),
|
||||||
|
array('prices', array('prex', 'prix', 'price')),
|
||||||
array('quizzes', 'quiz'),
|
array('quizzes', 'quiz'),
|
||||||
array('scarves', array('scarf', 'scarve', 'scarff')),
|
|
||||||
array('spies', 'spy'),
|
|
||||||
array('stories', 'story'),
|
|
||||||
array('syllabi', 'syllabus'),
|
|
||||||
array('thieves', array('thief', 'thieve', 'thieff')),
|
|
||||||
array('waltzes', array('waltz', 'waltze')),
|
|
||||||
array('wharves', array('wharf', 'wharve', 'wharff')),
|
|
||||||
array('caves', array('caf', 'cave', 'caff')),
|
|
||||||
array('staves', array('staf', 'stave', 'staff')),
|
|
||||||
array('wives', 'wife'),
|
|
||||||
array('ions', 'ion'),
|
|
||||||
array('bases', array('bas', 'base', 'basis')),
|
|
||||||
array('cars', 'car'),
|
|
||||||
array('cassettes', array('cassett', 'cassette')),
|
|
||||||
array('lamps', 'lamp'),
|
|
||||||
array('hats', 'hat'),
|
|
||||||
array('cups', 'cup'),
|
|
||||||
array('boxes', 'box'),
|
|
||||||
array('sandwiches', array('sandwich', 'sandwiche')),
|
|
||||||
array('suitcases', array('suitcas', 'suitcase', 'suitcasis')),
|
|
||||||
array('roses', array('ros', 'rose', 'rosis')),
|
|
||||||
array('garages', array('garag', 'garage')),
|
|
||||||
array('shoes', array('sho', 'shoe')),
|
|
||||||
array('days', 'day'),
|
|
||||||
array('boys', 'boy'),
|
|
||||||
array('roofs', 'roof'),
|
|
||||||
array('cliffs', 'cliff'),
|
|
||||||
array('sheriffs', 'sheriff'),
|
|
||||||
array('discos', 'disco'),
|
|
||||||
array('pianos', 'piano'),
|
|
||||||
array('photos', 'photo'),
|
|
||||||
array('trees', array('tre', 'tree')),
|
|
||||||
array('bees', array('be', 'bee')),
|
|
||||||
array('cheeses', array('chees', 'cheese', 'cheesis')),
|
|
||||||
array('radii', 'radius'),
|
array('radii', 'radius'),
|
||||||
array('objectives', 'objective'),
|
array('roofs', 'roof'),
|
||||||
array('moves', 'move'),
|
array('roses', array('ros', 'rose', 'rosis')),
|
||||||
|
array('sandwiches', array('sandwich', 'sandwiche')),
|
||||||
|
array('scarves', array('scarf', 'scarve', 'scarff')),
|
||||||
|
array('schemas', 'schema'), //schemata
|
||||||
|
array('sheriffs', 'sheriff'),
|
||||||
|
array('shoes', array('sho', 'shoe')),
|
||||||
|
array('spies', 'spy'),
|
||||||
|
array('staves', array('staf', 'stave', 'staff')),
|
||||||
|
array('stories', 'story'),
|
||||||
|
array('strata', array('straton', 'stratum')),
|
||||||
|
array('suitcases', array('suitcas', 'suitcase', 'suitcasis')),
|
||||||
|
array('syllabi', 'syllabus'),
|
||||||
|
array('tags', 'tag'),
|
||||||
|
array('teeth', 'tooth'),
|
||||||
|
array('theses', array('thes', 'these', 'thesis')),
|
||||||
|
array('thieves', array('thief', 'thieve', 'thieff')),
|
||||||
|
array('trees', array('tre', 'tree')),
|
||||||
|
array('waltzes', array('waltz', 'waltze')),
|
||||||
|
array('wives', 'wife'),
|
||||||
|
|
||||||
// test casing: if the first letter was uppercase, it should remain so
|
// test casing: if the first letter was uppercase, it should remain so
|
||||||
array('Men', 'Man'),
|
array('Men', 'Man'),
|
||||||
array('GrandChildren', 'GrandChild'),
|
array('GrandChildren', 'GrandChild'),
|
||||||
array('SubTrees', array('SubTre', 'SubTree')),
|
array('SubTrees', array('SubTre', 'SubTree')),
|
||||||
|
|
||||||
|
// Known issues
|
||||||
|
//array('insignia', 'insigne'),
|
||||||
|
//array('insignias', 'insigne'),
|
||||||
|
//array('rattles', 'rattle'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +149,13 @@ class StringUtilTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testSingularify($plural, $singular)
|
public function testSingularify($plural, $singular)
|
||||||
{
|
{
|
||||||
$this->assertEquals($singular, StringUtil::singularify($plural));
|
$single = StringUtil::singularify($plural);
|
||||||
|
if (is_string($singular) && is_array($single)) {
|
||||||
|
$this->fail("--- Expected\n`string`: " . $singular . "\n+++ Actual\n`array`: " . implode(', ', $single));
|
||||||
|
} elseif (is_array($singular) && is_string($single)) {
|
||||||
|
$this->fail("--- Expected\n`array`: " . implode(', ', $singular) . "\n+++ Actual\n`string`: " . $single);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->assertEquals($singular, $single);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
Tests/ export-ignore
|
|
||||||
phpunit.xml.dist export-ignore
|
|
Reference in New Issue
Block a user