Skip to content

Instantly share code, notes, and snippets.

@gpaddis
Last active February 8, 2019 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpaddis/8f15be088d64702555cad8c374833422 to your computer and use it in GitHub Desktop.
Save gpaddis/8f15be088d64702555cad8c374833422 to your computer and use it in GitHub Desktop.
Setup EcomDev_PHPUnit in a Magento 1.x directory
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "Usage: $0 db_name base_url"
exit 1
fi
dbName="$1"
baseUrl="$2"
test -f app/Mage.php || {
echo "Unable to find Magento in the current directory."
exit 1
}
test -d "app/code/community/EcomDev/PHPUnit" || {
echo "Ecomdev_PHPUnit is not installed in this shop."
exit 1
}
cd shell
test -f "../app/etc/local.xml.phpunit" || {
echo "Creating the configuration files..."
php -f ecomdev-phpunit.php -- --action install && php -f ecomdev-phpunit.php -- --action change-status
}
php ecomdev-phpunit.php -a magento-config --db-name $dbName --base-url $baseUrl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment