Git Product home page Git Product logo

Comments (3)

kasparsd avatar kasparsd commented on July 22, 2024

Could we require users to add the PHPUnit dependency to their project in composer.json instead?

A simple fix would be to check for an existing phpunit executable here before doing any install:

if check_should_execute 'phpunit'; then

as we do here already:

if check_should_execute 'phpunit' && ! command -v phpunit >/dev/null 2>&1; then

Thougts?

from wp-dev-lib.

kasparsd avatar kasparsd commented on July 22, 2024

Actually, the whole thing here might no longer be necessary:

if check_should_execute 'phpunit'; then
if [[ -z "$PHPUNIT_VERSION" ]]; then
if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then
PHPUNIT_VERSION='5.7'
elif [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
PHPUNIT_VERSION='4.8'
fi
fi
if [[ ! -z "$PHPUNIT_VERSION" ]]; then
mkdir -p $HOME/phpunit-bin/$PHPUNIT_VERSION
echo "Opting for phpunit $PHPUNIT_VERSION for PHP $TRAVIS_PHP_VERSION"
export PATH="$HOME/phpunit-bin/$PHPUNIT_VERSION:$PATH"
if [[ ! -e $HOME/phpunit-bin/$PHPUNIT_VERSION/phpunit ]]; then
wget -O $HOME/phpunit-bin/$PHPUNIT_VERSION/phpunit https://phar.phpunit.de/phpunit-$PHPUNIT_VERSION.phar
chmod +x $HOME/phpunit-bin/$PHPUNIT_VERSION/phpunit
fi
fi
fi

since we're already installing PHPunit during install_tools:

if check_should_execute 'phpunit' && ! command -v phpunit >/dev/null 2>&1; then
PHPUNIT_VERSION=${PHPUNIT_VERSION:-5.7}
echo "Downloading PHPUnit $PHPUNIT_VERSION phar"
download https://phar.phpunit.de/phpunit-$PHPUNIT_VERSION.phar "$TEMP_TOOL_PATH/phpunit"
chmod +x "$TEMP_TOOL_PATH/phpunit"
fi

which runs right after:

from wp-dev-lib.

swissspidy avatar swissspidy commented on July 22, 2024

@kasparsd Checking for an existing binary from composer makes sense to me. Adding that would be a nice enhancement still.

from wp-dev-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.