|
@@ -0,0 +1,24 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+
|
|
3
|
+# install software
|
|
4
|
+cd /root; git clone https://github.com/mevdschee/php-crud-api.git
|
|
5
|
+# download phpunit 4.8 for PHP < 5.6
|
|
6
|
+cd php-crud-api; wget https://phar.phpunit.de/phpunit-4.8.phar -O phpunit.phar
|
|
7
|
+# copy dist config to config
|
|
8
|
+cp tests/Config.php.dist tests/Config.php
|
|
9
|
+# replace variables
|
|
10
|
+sed -i 's/{{mysql_hostname}}/localhost/g' tests/Config.php
|
|
11
|
+sed -i 's/{{mysql_username}}/php-crud-api/g' tests/Config.php
|
|
12
|
+sed -i 's/{{mysql_password}}/php-crud-api/g' tests/Config.php
|
|
13
|
+sed -i 's/{{mysql_database}}/php-crud-api/g' tests/Config.php
|
|
14
|
+sed -i 's/{{pgsql_hostname}}/localhost/g' tests/Config.php
|
|
15
|
+sed -i 's/{{pgsql_username}}/php-crud-api/g' tests/Config.php
|
|
16
|
+sed -i 's/{{pgsql_password}}/php-crud-api/g' tests/Config.php
|
|
17
|
+sed -i 's/{{pgsql_database}}/php-crud-api/g' tests/Config.php
|
|
18
|
+sed -i 's/{{sqlite_hostname}}//g' tests/Config.php
|
|
19
|
+sed -i 's/{{sqlite_username}}//g' tests/Config.php
|
|
20
|
+sed -i 's/{{sqlite_password}}//g' tests/Config.php
|
|
21
|
+sed -i 's/{{sqlite_database}}/tests\/sqlite.db/g' tests/Config.php
|
|
22
|
+# move comments
|
|
23
|
+sed -i 's/\/\* Uncomment/\/\/ Uncomment/g' tests/Config.php
|
|
24
|
+sed -i "s/'SQLServer'/\/\* 'SQLServer'/g" tests/Config.php
|