Skip to content

Commit 19d6289

Browse files
authored
Merge pull request #237 from karllhughes/master
Adding travis configuration
2 parents c3a8303 + 97fcaab commit 19d6289

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
dist: trusty
2+
sudo: false
3+
4+
language: php
5+
6+
services:
7+
# - mysql
8+
- postgresql
9+
10+
addons:
11+
postgresql: "9.4"
12+
13+
php:
14+
- 5.4
15+
- 5.5
16+
- 5.6
17+
- 7.0
18+
- 7.1
19+
20+
before_install:
21+
- phpenv config-add travisphp.ini
22+
- psql -c 'create database testing;' -U postgres
23+
- psql -U postgres -c "create extension postgis"
24+
# - mysql -e 'CREATE DATABASE testing;'
25+
- cp tests/config.php.travis tests/config.php
26+
27+
script:
28+
- curl https://phar.phpunit.de/phpunit-4.8.phar -L -o phpunit.phar && chmod +x phpunit.phar
29+
- php phpunit.phar

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/mevdschee/php-crud-api.svg)](http://isitmaintained.com/project/mevdschee/php-crud-api "Average time to resolve an issue")
22
[![Percentage of issues still open](http://isitmaintained.com/badge/open/mevdschee/php-crud-api.svg)](http://isitmaintained.com/project/mevdschee/php-crud-api "Percentage of issues still open")
3+
[![Build Status](https://travis-ci.org/mevdschee/php-crud-api.svg?branch=master)](https://travis-ci.org/mevdschee/php-crud-api)
34

45
# PHP-CRUD-API
56

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"require": {
2929
"php": ">=5.3.0"
3030
},
31+
"require-dev": {
32+
"phpunit/phpunit": "^5.7.0"
33+
},
3134
"autoload": {
3235
"files": ["api.php"]
3336
}

tests/config.php.travis

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
class PHP_CRUD_API_Config
4+
{
5+
/**
6+
* Configure one or more database connections as associative arrays.
7+
* Tests will be run against any database connection specified here.
8+
*
9+
* @var array
10+
*/
11+
public static $config = array(
12+
/* MySQL is disabled because v5.7 is required for all tests to pass,
13+
and Travis only has up to MySQL 5.6 installed by default. This
14+
will be runnable once we have a test suite that adapts to the
15+
available MySQL version. See: https://github.com/mevdschee/php-crud-api/issues/194
16+
array(
17+
'dbengine' => 'MySQL',
18+
'hostname' => 'localhost',
19+
'username' => 'root',
20+
'password' => 'travis',
21+
'database' => 'testing',
22+
),
23+
*/
24+
array(
25+
'dbengine' => 'PostgreSQL',
26+
'hostname' => 'localhost',
27+
'username' => 'postgres',
28+
'password' => '',
29+
'database' => 'testing',
30+
),
31+
array(
32+
'dbengine' => 'SQLite',
33+
'hostname' => '',
34+
'username' => '',
35+
'password' => '',
36+
'database' => 'tests/sqlite.db',
37+
),
38+
);
39+
}

travisphp.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mysql.default_socket = "/run/mysql-5.6/mysqld.sock"
2+
mysqli.default_socket = "/run/mysql-5.6/mysqld.sock"
3+
pdo_mysql.default_socket = "/run/mysql-5.6/mysqld.sock"
4+
error_reporting = E_ALL & ~E_STRICT & ~E_NOTICE & ~E_DEPRECATED

0 commit comments

Comments
 (0)