Last change
on this file since 640 was
468,
checked in by anonymous, 11 years ago
|
Completed integrating /branches/eli_branch into /trunk. Changes include:
- Removed closing ?> from end of files
- Upgrade old-style contructor methods to use construct() instead.
- Class properties and methods defined as public, private, static or protected
- Ensure code runs under E_ALL with only mysql_* deprecated warnings
- Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
- Run the php cli -l option to check files for syntax errors.
- Bring tests up-to-date with latest version and methods of PHPUnit
|
File size:
948 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | # This script sets-up the test environment and runs all tests. |
---|
4 | # You'll want to define your local mysql credentials for a test |
---|
5 | # database as environment variables, e.g., in ~/.bash_profile: |
---|
6 | # export DB_NAME="test" |
---|
7 | # export DB_USER="test" |
---|
8 | # export DB_PASS="..." |
---|
9 | |
---|
10 | # Be in the directory with all the tests. |
---|
11 | cd `dirname $0`; |
---|
12 | |
---|
13 | # Get required ENV variables. |
---|
14 | if [[ -z "$DB_USER$DB_PASS$DB_NAME" ]]; then |
---|
15 | echo "MySQL test DB credential environment variables are missing.\nSet these in ~/.bash_profile to avoid seeing these prompts each time."; |
---|
16 | fi |
---|
17 | for E in DB_USER DB_PASS DB_NAME; do |
---|
18 | while [[ -z ${!E} ]]; do |
---|
19 | read -p "$E: " $E; |
---|
20 | done |
---|
21 | export $E; |
---|
22 | done |
---|
23 | |
---|
24 | # Create database. |
---|
25 | mysql -e 'CREATE DATABASE IF NOT EXISTS `test`'; |
---|
26 | |
---|
27 | # Go! |
---|
28 | echo "Running the tests!"; |
---|
29 | echo "You'll want to 'tail -f /tmp/codebase_test_log' and watch for errors."; |
---|
30 | |
---|
31 | # Config options go in phpunit.xml |
---|
32 | # phpunit --tap | grep -v '^ok ' |
---|
33 | phpunit --stderr |
---|
Note: See
TracBrowser
for help on using the repository browser.