Skip to content

Commit

Permalink
#35: Check if extension is correctly installed and test removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Rombauts committed Sep 25, 2017
1 parent 6a5d868 commit 9a2a605
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ addons:

cache:
directories:
- vendor
- $HOME/.composer/cache
- $HOME/.composer

before_install:
- export PATH=$PATH:/home/travis/.composer/vendor/bin/
Expand All @@ -25,6 +24,19 @@ before_script:
script:
- joomla site:create --www=$DOCUMENTROOT --mysql-login="root" composer
- composer require -vvv --working-dir=$DOCUMENTROOT/composer --no-interaction joomlatools/composer-helloworld
# Verify if component file is present
- "[ -f $DOCUMENTROOT/composer/administrator/components/com_helloworld/helloworld.php ] && true || false"
- grep -q "echo 'Hello World\!'" helloworld.php && true || false
# Test if the row exists in the database
- COUNT=$(mysql -uroot -s -N -e "SELECT COUNT(extension_id) FROM sites_composer.j_extensions WHERE element = 'com_helloworld';")
- "[ $COUNT -gt 0 ] && true || false"
# Test uninstall
- composer remove -vvv --working-dir=$DOCUMENTROOT/composer --no-interaction joomlatools/composer-helloworld
# Verify if component file has been removed
- "[ ! -f $DOCUMENTROOT/composer/administrator/components/com_helloworld/helloworld.php ] && true || false"
# Ensure extensions table has been updated
- COUNT=$(mysql -uroot -s -N -e "SELECT COUNT(extension_id) FROM sites_composer.j_extensions WHERE element = 'com_helloworld';")
- "[ $COUNT -eq 0 ] && true || false"

matrix:
fast_finish: true
6 changes: 1 addition & 5 deletions _travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

set -e

echo "Updating Composer"
composer self-update && composer --version
composer -V

echo "Installing joomlatools/console"
composer global require --no-interaction joomlatools/console
joomla -V
joomla -V

0 comments on commit 9a2a605

Please sign in to comment.