Skip to content

Commit

Permalink
bug #279 [Core] Fix failing LanguageTypeTest (sstok)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.0-dev branch.

Discussion
----------

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets | 
| License       | MIT

Localized languages were removed in Intl, this reflects the same changes as done in the Symfony Form component

Commits
-------

83cbd66 [Core] Fix failing LanguageTypeTest
5461e53 Upgrade PHP version
  • Loading branch information
sstok committed Mar 19, 2020
2 parents 789647e + 5461e53 commit 336018b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- elasticsearch
- pgsql
- mariadb-server
image: rollerworks/search-dev:latest
image: rollerworks/search-dev:php-72
volumes:
- .:/srv/www:rw

Expand Down
17 changes: 10 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM composer:1.7.3
FROM php:7.1-cli
FROM php:7.2-cli

ENV BUILD_DEPS="autoconf file g++ gcc libc-dev pkg-config re2c"
ENV LIB_DEPS="git make unzip ca-certificates zlib1g-dev libpq5 postgresql-server-dev-9.6"
ENV LIB_DEPS="git make unzip ca-certificates zlib1g-dev libpq5 postgresql-server-dev-11"
ENV ICU_RELEASE=60.1
ENV CXXFLAGS "--std=c++0x"

Expand All @@ -17,13 +16,17 @@ RUN echo "date.timezone=Europe/Amsterdam" >> $PHP_INI_DIR/php.ini \
&& docker-php-ext-configure intl && docker-php-ext-install intl \
&& apt-get purge -y --auto-remove $BUILD_DEPS

COPY --from=0 /usr/bin/composer /usr/bin/composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN ln -s /usr/bin/composer /usr/bin/composer.phar

WORKDIR /srv/www

# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative
# install Symfony Flex globally to speed up download of Composer packages (parallelized prefetching)
RUN set -eux; \
composer global require "symfony/flex" --prefer-dist --no-progress --no-suggest --classmap-authoritative; \
composer clear-cache
ENV PATH="${PATH}:/root/.composer/vendor/bin"

WORKDIR /srv/www

CMD icu-config --version && php -i | grep 'ICU version'
10 changes: 4 additions & 6 deletions lib/Core/Tests/Extension/Core/Type/LanguageTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,21 @@ protected function setUp()
parent::setUp();
}

public function testCurrenciesAreSelectable()
public function testChoicesAreSelectable()
{
$field = $field = $this->getFactory()->createField('choice', LanguageType::class);
$field->finalizeConfig();

FieldTransformationAssertion::assertThat($field)
->withInput('British English', 'en_GB')
->successfullyTransformsTo('en_GB')
->andReverseTransformsTo('British English', 'en_GB');
->withInput('English', 'en')
->successfullyTransformsTo('en')
->andReverseTransformsTo('English', 'en');

$view = $field->createView(new FieldSetView());

$choices = $view->vars['choices'];

$this->assertContains(new ChoiceView('en', 'en', 'English'), $choices, '', false, false);
$this->assertContains(new ChoiceView('en_GB', 'en_GB', 'British English'), $choices, '', false, false);
$this->assertContains(new ChoiceView('en_US', 'en_US', 'American English'), $choices, '', false, false);
$this->assertContains(new ChoiceView('fr', 'fr', 'French'), $choices, '', false, false);
$this->assertContains(new ChoiceView('my', 'my', 'Burmese'), $choices, '', false, false);
}
Expand Down

0 comments on commit 336018b

Please sign in to comment.