Merge branch 'master' of github.com:phpmyadmin/phpmyadmin

This commit is contained in:
Madhura Jayaratne 2014-12-05 07:36:38 +05:30
commit 49109dc2e5
6 changed files with 69 additions and 60 deletions

View File

@ -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

View File

@ -149,7 +149,7 @@
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<apply executable="php" failonerror="true" output="${basedir}/build/logs/lint.log" logError="true">
<arg value="-l" />
<fileset dir="${basedir}">

View File

@ -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"
}
}

View File

@ -2704,20 +2704,28 @@ class PMA_Util
. (! empty($class) ? ' class="' . htmlspecialchars($class) . '"' : '')
. '>';
if (!empty($placeholder)) {
$result .= '<option value="" disabled="disabled"'
. ' selected="selected">' . $placeholder . '</option>';
}
$resultOptions = '';
$selected = false;
foreach ($choices as $one_choice_value => $one_choice_label) {
$result .= '<option value="' . htmlspecialchars($one_choice_value) . '"';
$resultOptions .= '<option value="' . htmlspecialchars($one_choice_value) . '"';
if ($one_choice_value == $active_choice && empty($placeholder)) {
$result .= ' selected="selected"';
if ($one_choice_value == $active_choice) {
$resultOptions .= ' selected="selected"';
$selected = true;
}
$result .= '>' . htmlspecialchars($one_choice_label) . '</option>';
$resultOptions .= '>' . htmlspecialchars($one_choice_label) . '</option>';
}
$result .= '</select>';
if (!empty($placeholder)) {
$resultOptions = '<option value="" disabled="disabled"'
. ( !$selected ? ' selected="selected"' : '' )
. '>' . $placeholder . '</option>'
. $resultOptions;
}
$result .= $resultOptions
. '</select>';
return $result;
}

11
test/install-browserstack Executable file
View File

@ -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

17
test/install-runkit Executable file
View File

@ -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