| 1 |
lars |
1 |
===================
|
|
|
2 |
HOW TO TEST PEAR DB
|
|
|
3 |
===================
|
|
|
4 |
|
|
|
5 |
INTRODUCTION
|
|
|
6 |
============
|
|
|
7 |
|
|
|
8 |
These are instructions for testing PEAR DB on a Windows machine using a
|
|
|
9 |
Cygwin Bash shell. Adjust the paths and commands to match your system.
|
|
|
10 |
This configuration is used because these precise steps are known to work.
|
|
|
11 |
|
|
|
12 |
NOTE: You must log on as a user which has permissions to modify the
|
|
|
13 |
contents of your PHP executable's directory. This is necessary for both
|
|
|
14 |
configuring AND running the test system.
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
INSTALLATION
|
|
|
18 |
============
|
|
|
19 |
|
|
|
20 |
Obtain PHP's Test Framework
|
|
|
21 |
---------------------------
|
|
|
22 |
If you don't have PHP's test framework, you need to obtain it. These
|
|
|
23 |
steps include changing the working directory, downloading run-tests.php
|
|
|
24 |
via SVN and copying the file into place. Change the branch in the
|
|
|
25 |
SVN command as appropriate for your present version of PHP.
|
|
|
26 |
|
|
|
27 |
cd c:/progra~1/php
|
|
|
28 |
svn checkout \
|
|
|
29 |
https://svn.php.net/repository/php/php-src/branches/PHP_5_3/run-tests.php
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
Obtain DB and its Test Framework
|
|
|
33 |
--------------------------------
|
|
|
34 |
* IF PEAR DB IS ALREADY INSTALLED:
|
|
|
35 |
|
|
|
36 |
If you have PEAR DB installed already, good. The test suite
|
|
|
37 |
is in place. Open up a command/shell prompt and move into
|
|
|
38 |
the test directory.
|
|
|
39 |
|
|
|
40 |
cd <path to pear insall>/tests/DB/tests
|
|
|
41 |
|
|
|
42 |
* VIA A NEW INSTALLATION USING THE PEAR INSTALLER:
|
|
|
43 |
|
|
|
44 |
Installing PEAR has gotten fairly easy. Follow the instructions
|
|
|
45 |
from the manual: http://pear.php.net/manual/en/installation.php
|
|
|
46 |
Once PEAR and DB are installed, move to the test directory.
|
|
|
47 |
|
|
|
48 |
cd pear/tests/DB/tests
|
|
|
49 |
|
|
|
50 |
* VIA SVN:
|
|
|
51 |
|
|
|
52 |
Create a location to store the test installation of DB and its
|
|
|
53 |
test scripts.
|
|
|
54 |
|
|
|
55 |
d:
|
|
|
56 |
mkdir peartest
|
|
|
57 |
svn checkout https://svn.php.net/repository/pear/packages/DB/trunk peartest
|
|
|
58 |
cd peartest
|
|
|
59 |
|
|
|
60 |
We assume you already have the PEAR base package installed. If
|
|
|
61 |
you don't, you will need to do so, but the instructions for
|
|
|
62 |
doing that are beyond the scope of this document. See
|
|
|
63 |
http://pear.php.net/manual/en/installation.php for more info.
|
|
|
64 |
|
|
|
65 |
Move to the test directory.
|
|
|
66 |
|
|
|
67 |
cd pear/DB/tests
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
Copy the Starter Shell Script and Edit the Paths
|
|
|
71 |
------------------------------------------------
|
|
|
72 |
To make starting up each test run easier, we have included two shell
|
|
|
73 |
scripts. The original files are named "run.cvs". They need to be
|
|
|
74 |
renamed to "run" so SVN won't bother you with tracking them. Then,
|
|
|
75 |
the paths and file names in them need to be set to those used by
|
|
|
76 |
your system.
|
|
|
77 |
|
|
|
78 |
cp run.cvs run
|
|
|
79 |
chmod 755 run
|
|
|
80 |
vi run
|
|
|
81 |
|
|
|
82 |
cd driver
|
|
|
83 |
cp run.cvs run
|
|
|
84 |
chmod 755 run
|
|
|
85 |
vi run
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Copy the Setup File and Edit the DSN's
|
|
|
89 |
--------------------------------------
|
|
|
90 |
The test suite contains a file in the driver directory that stores
|
|
|
91 |
the DSN's needed to connect to your database. Then you'll need to
|
|
|
92 |
edit the DSN's in it.
|
|
|
93 |
|
|
|
94 |
vi setup.inc
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
RUN THE TESTS
|
|
|
98 |
=============
|
|
|
99 |
|
|
|
100 |
To run all tests: ./run
|
|
|
101 |
To run one test: ./run <test file name>
|
|
|
102 |
Example: ./run db_parsedsn.phpt
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
Test Types and Locations
|
|
|
106 |
------------------------
|
|
|
107 |
tests Common PEAR DB tests
|
|
|
108 |
tests/driver Common tests for all the drivers
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
Results and What To Do With Them
|
|
|
112 |
--------------------------------
|
|
|
113 |
Each test that fails generates a .php (which you can execute), a .exp
|
|
|
114 |
(the expected output), a .out (the test output) and a .diff (a diff -u
|
|
|
115 |
from the .exp and .out files).
|
|
|
116 |
|
|
|
117 |
If you run the tests, please report or fill the TEST CONFORMANCE table
|
|
|
118 |
in the STATUS document. Before any commit to SVN be sure to run the
|
|
|
119 |
tests and nothing got broken with the change.
|
|
|
120 |
|
|
|
121 |
If you get the message "SKIP", means that the test it's not executed.
|
|
|
122 |
Look at the DB/tests/driver/skipif.inc to see what's the problem
|
|
|
123 |
(probably a connection problem).
|
|
|
124 |
|
|
|
125 |
|
|
|
126 |
DB TESTER MATRIX
|
|
|
127 |
================
|
|
|
128 |
fbsql ifx mssql mysqli odbc sqlite
|
|
|
129 |
TESTER dbase | ibase | msql | mysql | oci8 | pgsql | sybase
|
|
|
130 |
John Horton - - - X - - - - - - - - -
|
|
|
131 |
Tim Zickus - - - - - - - - X - - - -
|
|
|
132 |
Tim Parkin - - - - - - - - X - - - -
|
|
|
133 |
Paul Gardiner - - - X - - - - - - - - -
|
|
|
134 |
peterwb@iafrica.com - - - X - - - - - - - - -
|
|
|
135 |
Daniel, Adam - - - - - - - - X - - - -
|
|
|
136 |
szii@sziisoft.com - - - - - - - - - X¹ - - -
|
|
|
137 |
jmh3@linuxfreak.com - - - - - - - - - - X - -
|
|
|
138 |
Kevin Henrikson - - - - - - - - X - - - -
|
|
|
139 |
Stig Bakken - - - - - - X - - - X - -
|
|
|
140 |
Chuck Hagenbuch - - - - - X - - - - - - -
|
|
|
141 |
Ludovico Magnocavallo - - X - - - - - - - - - -
|
|
|
142 |
Daniel Convissor X X X - X X X X X X² X X X
|
|
|
143 |
|
|
|
144 |
MISSING TESTERS - - - - - - - - - - - - -
|
|
|
145 |
|
|
|
146 |
Comments:
|
|
|
147 |
|
|
|
148 |
[1]: ODBC using IBM DB2
|
|
|
149 |
[2]: ODBC using IBM DB2 and MS Access
|