Commit 2319805
Add AppVeyor CI support (joomla#72)
* Create phpunit.appveyor.xml
the php unit file for app veyor DSN items
* Create appveyor.yml
First draft of the appveyor configuration
* Rename appveyor.yml to .appveyor.yml
* need PDO drivers in php.ini
* try host and password change
* try without password
* try absolute path
* revert absolute path
* Add PHP info output temporarily
* Don't need to manually import PDO, don't import OCI8, comment mssql for now
* Install sqlite
* Enable sqlite3 extension
* Add non-PDO PostgreSQL and MySQLi
* Set database credentials
* Attempt to create the DB tables
* Try postgres command line items
https://www.appveyor.com/docs/services-databases/
* default is PostgreSQL 9.4
* mysql port for appvoyer is 3306
* Database setup for mysql and postgreSQL
* fix directory spelling for mysql
* try without single - on each line
* try a different table create format
* adjust sql install lines
* fix yml parsing
* try fixing sql import
* fix yml parsing again
* password needed
* remove superfluous semicolon
* fix / vs \
* database setup for MSSQL
* Is powershell script without `- >` ?
* Is the powershell scripting needing single `-` ?
* Turn off php -i output, remove switch
* try with single -
* all powerscript items start with - ps:
* completely redo the MSSQL table creation
* Don't need composer show output
* Try to detect the PHP version and download the needed DLLs
* do the DLL downloads before all the other items
* try tweaking the dll conditionals
* chain IF for && (and) equivalence
* try $Env:php_ver_target for condition
* Install DLLs after moving to php dir, install non-PDO DLLs, enable them
* try if as a powershell item
* try $env:PHP
* nul is batch syntax. In PowerShell you use $null
* try Remove-Item
* Specify postgresql94 since appveyor is now postgresql95 by default with postgresql
* Fix PHP 7.0 filenames, try /Y switch
* ... or not ...
* List directory contents, something's not right
* Now make sure the extensions are there
* try NTS.dll
is the not thread safe the correct version to use?
* extension type nts
* SQLSVR host is (local)\SQL2014
* try adjusting MSSQL db create
* try adjusting pgsql db create
* dependencies: lowest is broken, just work with current
* is MSSQL interfering with other databases?
* is the mysql port causing problems?
* try sqlcmd -b -E -S
* before_build will never run with build: false, need to use before_test
this should fix the DB issues
* Fix pgSQL
* try to force PHP 5.6 to x86
* try to fix parsing error
* try fixing yml again
* should be valid yml now
* Simplify the IF %PHP%==1 conditions for echo block
only need to check once If ($env:PHP -eq "1") for the block of echo's
* revert condensed if check due to parse error
multiple errors of the following type
```bat
The output stream for this command is already redirected
```
* remove Get-ChildItem -Path c:\tools\php\ext
We no longer need this debug info as we solved the DLL load issue by using the right file version
* try setting USE $db in SQLSVR set up
* remove commented lines and unnecessary commands
* Fix the SQLSVR tests
Information based on the references below
It seems that PHPUnit deletes the content of the table in question before setting up the table to execute a test. That only works, if the table already exists. Therefore I’ve added a create table jos_dbtest statement with the PDO to fix the issue
PHP unit will perform a ‘clean insert’ operation on our database using the the dataset returned by getDataSet. The clean insert operation will truncate or delete_all any tables in the data set (not all tables in the database) and then insert the rows in the dataset. The solution is to create the table before running the test.
Additionally we can modify the default functionality by overriding the getSetUpOperation() and getTearDownOperation() methods
- https://andreas.heigl.org/2015/08/16/database-testing-with-phpunit-and-sqlite/
- http://stackoverflow.com/questions/10948273/loading-schema-from-sql-file-in-phpunit-test1 parent fa8e994 commit 2319805
File tree
3 files changed
+126
-0
lines changed- Tests
3 files changed
+126
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments