Changeset 599
- Timestamp:
- Apr 27, 2017 2:57:13 PM (7 years ago)
- Location:
- trunk/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/_config.inc.php
r468 r599 28 28 */ 29 29 require_once '../lib/App.inc.php'; 30 require_once '../lib/DB.inc.php'; 30 31 31 32 $app =& App::getInstance('testapp'); … … 44 45 'db_debug' => true, 45 46 'db_die_on_failure' => true, 46 'db_server' => 'localhost',47 'db_server' => getenv('DB_SERVER'), 47 48 'db_name' => getenv('DB_NAME'), 48 49 'db_user' => getenv('DB_USER'), -
trunk/tests/phpunit.xml
r541 r599 1 <!-- 2 For config options see: 3 http://phpunit.de/manual/current/en/appendixes.configuration.html 4 5 Run all scripts by executing ./run_tests.sh 6 --> 7 <phpunit 1 <?xml version="1.0" encoding="UTF-8"?> 2 <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd" 4 backupGlobals="false" 5 beStrictAboutCoversAnnotation="true" 6 beStrictAboutOutputDuringTests="true" 7 beStrictAboutTestsThatDoNotTestAnything="true" 8 beStrictAboutTodoAnnotatedTests="true" 8 9 convertErrorsToExceptions="false" 9 10 convertNoticesToExceptions="false" … … 21 22 <includePath>.</includePath> 22 23 <includePath>/opt</includePath> 23 <testsuites> 24 <testsuite name="Codebase_Tests"> 25 <file>AppTest.php</file> 26 <file>AuthFileTest.php</file> 27 <!-- <file>AuthorizeNetTest.php</file> --> 28 <file>AuthSQLTest.php</file> 29 <file>CSSTest.php</file> 30 <file>DBSessionHandlerTest.php</file> 31 <file>EmailTest.php</file> 32 <file>FormValidatorTest.php</file> 33 <file>LockTest.php</file> 34 <file>PayPalTest.php</file> 35 <file>VersionTest.php</file> 36 <file>UtilitiesTest.php</file> 37 </testsuite> 38 </testsuites> 24 <testsuite> 25 <file>AppTest.php</file> 26 <!-- <file>AuthFileTest.php</file> --> 27 <!-- <file>AuthorizeNetTest.php</file> --> 28 <!-- <file>AuthSQLTest.php</file> --> 29 <!-- <file>CSSTest.php</file> --> 30 <!-- <file>DBSessionHandlerTest.php</file> --> 31 <!-- <file>EmailTest.php</file> --> 32 <!-- <file>FormValidatorTest.php</file> --> 33 <!-- <file>LockTest.php</file> --> 34 <!-- <file>PayPalTest.php</file> --> 35 <!-- <file>VersionTest.php</file> --> 36 <!-- <file>UtilitiesTest.php</file> --> 37 </testsuite> 38 39 <filter> 40 <whitelist processUncoveredFilesFromWhitelist="true"> 41 <directory suffix=".php">src</directory> 42 </whitelist> 43 </filter> 39 44 </phpunit> -
trunk/tests/run_tests.sh
r541 r599 8 8 # export DB_PASS="..." 9 9 10 function err { 11 MSG="$1"; 12 IFS=''; 13 echo -e $MSG 1>&2 14 exit 1; 15 } 16 10 17 # Be in the directory with all the tests. 11 18 cd `dirname $0`; … … 15 22 echo "MySQL test DB credential environment variables are missing.\nSet these in ~/.bash_profile to avoid seeing these prompts each time."; 16 23 fi 17 for E in DB_ USER DB_PASS DB_NAME; do24 for E in DB_SERVER DB_NAME DB_USER DB_PASS; do 18 25 while [[ -z ${!E} ]]; do 19 26 read -p "$E: " $E; … … 23 30 24 31 # Create database. 25 mysql -e 'CREATE DATABASE IF NOT EXISTS `test`';32 mysql -e "CREATE DATABASE IF NOT EXISTS \`${DB_NAME}\`" || err "Failed to create database '${DB_NAME}"; 26 33 27 34 # Go! … … 31 38 # Config options go in phpunit.xml 32 39 # phpunit --tap | grep -v '^ok ' 33 phpunit --stderr || echo "Something went wrong (if there is no output above, check the php_error_log)"; 40 phpunit --stderr --colors --debug || err "\nSomething went wrong (code $?). If there is no output above, check the php_error_log"; 41
Note: See TracChangeset
for help on using the changeset viewer.