diff --git a/.travis.yml b/.travis.yml index 1cc4969027..fb0cfe14c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,84 +17,56 @@ sudo: false env: matrix: - PHPUNIT_ARGS="--exclude-group selenium" - - LINT="yes" global: - secure: "TR3s7lHkREN706g+FeNXl1S0R2fpcI1H+n8USIkl5WBd7S2/NpsZlSfkrgnC7/xRBDXzHwuYd8JQQyAZyrqPEeLqIqlKzxIcTHOiJWGeR/YO7JXsr1Slt/nFqygpIyz8yOh3QIvX6FMzPsamBlUNhRvTAkd2wXPMBpXQlhTVmX8=" - TESTSUITE_BROWSERSTACK_USER=phpMyAdmin - TESTSUITE_USER=root - TESTSUITE_PASSWORD=root + - TESTSUITE_URL=http://127.0.0.1:8000 before_script: - export PATH=~/.composer/vendor/bin/:$PATH - - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')" ; - - set -e ; if [[ -z "$LINT" ]] ; then - - composer install --dev --no-interaction ; - - if [[ $TRAVIS_PHP_VERSION != "hhvm" ]] ; then - - git clone --depth=1 git://github.com/zenovich/runkit.git ; - cd runkit ; - if [[ $TRAVIS_PHP_VERSION = "5.6" ]] ; then - wget https://github.com/zenovich/runkit/pull/71.diff ; - patch -p1 < 71.diff ; - fi ; - phpize ; - ./configure ; - make ; - make install ; - cd .. ; - - phpenv config-add test/travis.php.ini ; - - wget https://scrutinizer-ci.com/ocular.phar ; - - fi ; - - if [[ ! -z "$SELENIUM" ]] ; then - - php --server 127.0.0.1:8000 & - - wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip ; - unzip BrowserStackLocal-linux-x64.zip ; - ./BrowserStackLocal -localIdentifier "travis-$TRAVIS_JOB_NUMBER" -onlyAutomate "$TESTSUITE_BROWSERSTACK_KEY" 127.0.0.1,8000,0 & - - mysql -uroot -p$TESTSUITE_PASSWORD < examples/create_tables.sql ; - - fi ; - fi + - mysql -uroot -e "CREATE DATABASE test" + - mysql -uroot < examples/create_tables.sql + - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')" + - composer install --dev --no-interaction + - if [ $TRAVIS_PHP_VERSION != "hhvm" ] ; then ./test/install-runkit ; fi + - if [ -n "$SELENIUM" ] ; then ./test/install-browserstack ; fi + - if [ -n "$SELENIUM" ] ; then php --server 127.0.0.1:8000 > php.log & fi + - if [ -n "$SELENIUM" ] ; then ~/browserstack/BrowserStackLocal -localIdentifier "travis-$TRAVIS_JOB_NUMBER" -onlyAutomate "$TESTSUITE_BROWSERSTACK_KEY" 127.0.0.1,8000,0 & fi script: + - ant clean - ant locales - - set -e; if [[ -z "$LINT" ]] ; then - export TESTSUITE_URL="http://127.0.0.1:8000" ; - if [[ $TRAVIS_PHP_VERSION == "hhvm" ]] ; then + - ant lint + - set -e; + if [ $TRAVIS_PHP_VERSION == "hhvm" ] ; then ant phpunit-hhvm ; else - if [[ ! -z "$SELENIUM" ]] ; then + if [ ! -z "$SELENIUM" ] ; then ant phpunit-nocoverage ; else ant phpunit ; fi ; - fi ; - else - ant lint ; fi after_script: - - if [[ -f build/logs/clover.xml ]] ; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml || true ; fi - - if [[ -f vendor/bin/coveralls ]] ; then php vendor/bin/coveralls -v || true ; fi + - if [ -f build/logs/clover.xml ] ; then php vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml || true ; fi + - if [ -f vendor/bin/coveralls ] ; then php vendor/bin/coveralls -v || true ; fi + - if [ -f php.log ] ; then cat php.log ; fi matrix: allow_failures: - - php: 5.5 + - php: 5.6 env: PHPUNIT_ARGS="--group selenium" SELENIUM="yes" - php: hhvm env: PHPUNIT_ARGS="--exclude-group selenium" fast_finish: true include: - - php: 5.5 + - php: 5.6 env: PHPUNIT_ARGS="--group selenium" SELENIUM="yes" cache: directories: - $HOME/.composer/cache/ + - $HOME/browserstack + - $HOME/runkit diff --git a/build.xml b/build.xml index cbd3e2827d..41ab34e7ec 100644 --- a/build.xml +++ b/build.xml @@ -149,7 +149,7 @@ - + diff --git a/composer.json b/composer.json index 117a2c855c..c78d034eb8 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "require-dev": { "satooshi/php-coveralls": ">=0.6", "phpunit/phpunit": "<4.2", - "phpunit/phpunit-selenium": ">=1.2" + "phpunit/phpunit-selenium": ">=1.2", + "scrutinizer/ocular": ">=1.0.0" } } diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 2e291c1701..34f6b80d57 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -2704,20 +2704,28 @@ class PMA_Util . (! empty($class) ? ' class="' . htmlspecialchars($class) . '"' : '') . '>'; - if (!empty($placeholder)) { - $result .= ''; - } + $resultOptions = ''; + $selected = false; foreach ($choices as $one_choice_value => $one_choice_label) { - $result .= ''; } - $result .= ''; + + if (!empty($placeholder)) { + $resultOptions = '' + . $resultOptions; + } + + $result .= $resultOptions + . ''; return $result; } diff --git a/test/install-browserstack b/test/install-browserstack new file mode 100755 index 0000000000..db4ab36fa8 --- /dev/null +++ b/test/install-browserstack @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +mkdir -p ~/browserstack +cd ~/browserstack +if [ ! -f BrowserStackLocal ] ; then + wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip + unzip BrowserStackLocal-linux-x64.zip +fi + diff --git a/test/install-runkit b/test/install-runkit new file mode 100755 index 0000000000..4789479b61 --- /dev/null +++ b/test/install-runkit @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +if [ $TRAVIS_PHP_VERSION = "5.6" ] ; then + git clone --depth=1 git://github.com/adrianguenter/runkit.git +else + git clone --depth=1 git://github.com/zenovich/runkit.git +fi +pushd runkit +phpize +./configure +make +make install +popd + +phpenv config-add test/travis.php.ini