Skip to content

Commit

Permalink
Merge pull request #80 from TwistPHP/add-coveralls-support
Browse files Browse the repository at this point in the history
Add coveralls support
  • Loading branch information
ahosgood committed Mar 15, 2016
2 parents f4d2631 + 0acc244 commit 13bc8fb
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 32 deletions.
26 changes: 13 additions & 13 deletions .travis.yml
Expand Up @@ -4,7 +4,9 @@ php:
- 5.3
- 5.4
- 5.5
env GULP=ON
- 5.6
env COVERALLS=ON
- 7.0
- hhvm
- nightly
Expand All @@ -24,26 +26,24 @@ before_install:
- mysql -V
- mysql -e "CREATE DATABASE IF NOT EXISTS travis_ci_twist_test;"
- mysql -e "SHOW DATABASES"
- npm install
- if [ "$GULP" = 'ON' ]; then npm install; fi;

install: php ./tests/install.php
install:
- if [ "$COVERALLS" = 'ON' ]; then composer require satooshi/php-coveralls '~1.0'; fi;
- php ./tests/install.php

before_script:
- mkdir -p ./build/logs
- mysql -e "USE travis_ci_twist_test; SHOW TABLES;"
- ls -lah ./tests
- sed -i 's/Twist::ServeRoutes(false);/echo "TwistPHP Framework Loaded!\n\n";/g' ./tests/index.php

script:
- phpunit ./tests/Database.php
- phpunit ./tests/Settings.php
- phpunit ./tests/Cache.php
- phpunit ./tests/Session.php
- phpunit ./tests/Views.php
- phpunit ./tests/User.php
- phpunit ./tests/Curl.php
- phpunit ./tests/Routes.php
- gulp test
- phpunit
- if [ "$GULP" = 'ON' ]; then gulp test; fi;

notifications:
on_success: never
on_failure: always
on_failure: always

after_success:
- if [ "$COVERALLS" = 'ON' ]; then ./vendor/bin/coveralls -v; fi;
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# [TwistPHP](https://twistphp.com/) ![TwistPHP logo](http://static.twistphp.com/logo/square/32.png)

[![Master build status](https://img.shields.io/travis/TwistPHP/TwistPHP/master.svg?label=master%20build)](https://travis-ci.org/TwistPHP/TwistPHP) [![Development build status](https://img.shields.io/travis/TwistPHP/TwistPHP/development.svg?label=development%20build)](https://travis-ci.org/TwistPHP/TwistPHP) [![Join the chat at https://gitter.im/TwistPHP/TwistPHP](https://img.shields.io/gitter/room/TwistPHP/TwistPHP.svg)](https://gitter.im/TwistPHP/TwistPHP) ![Licence](https://img.shields.io/badge/Licence-GPLv3-brightgreen.svg)
[![Master build status](https://img.shields.io/travis/TwistPHP/TwistPHP/master.svg?label=master%20build)](https://travis-ci.org/TwistPHP/TwistPHP) [![Development build status](https://img.shields.io/travis/TwistPHP/TwistPHP/development.svg?label=development%20build)](https://travis-ci.org/TwistPHP/TwistPHP) [![Coveralls](https://img.shields.io/coveralls/TwistPHP/TwistPHP.svg)](https://coveralls.io/github/TwistPHP/TwistPHP) [![Join the chat at https://gitter.im/TwistPHP/TwistPHP](https://img.shields.io/gitter/room/TwistPHP/TwistPHP.svg)](https://gitter.im/TwistPHP/TwistPHP) ![Licence](https://img.shields.io/badge/Licence-GPLv3-brightgreen.svg)

## A fresh, new open source PHP MVC micro framework

Expand Down
2 changes: 1 addition & 1 deletion dist/twist/Twist.php
Expand Up @@ -59,7 +59,7 @@ public static function version($strVersionPart = null){
$arrVersion = array(
'major' => 3,
'minor' => 0,
'patch' => 2,
'patch' => 3,
'pre-release' => 'dev'//pre-release can be set to 'dev'
);

Expand Down
41 changes: 41 additions & 0 deletions phpunit.xml.dist
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/index.php">
<php>
<ini name="error_reporting" value="E_ALL" />
</php>

<testsuites>
<testsuite name="PHP Coveralls component test suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./dist/twist</directory>
<exclude>
<file>./dist/twist/framework.php</file>
<directory>./dist/twist/Config</directory>
<file>./dist/twist/Core/boot.php</file>
<directory>./docs</directory>
<directory>./src</directory>
<directory>./tests</directory>
</exclude>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Settings extends \PHPUnit_Framework_TestCase{

public function testGet(){
Expand Down
2 changes: 0 additions & 2 deletions tests/User.php → tests/Core/Models/UserModel.Test.php
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class User extends \PHPUnit_Framework_TestCase{

public function testCreate(){
Expand Down
2 changes: 0 additions & 2 deletions tests/Cache.php → tests/Core/Utilities/Cache.Test.php
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Cache extends \PHPUnit_Framework_TestCase{

public function testReadWrite(){
Expand Down
4 changes: 1 addition & 3 deletions tests/Curl.php → tests/Core/Utilities/Curl.Test.php
@@ -1,8 +1,6 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Routes extends \PHPUnit_Framework_TestCase{
class Curl extends \PHPUnit_Framework_TestCase{

public function testGetRequest(){

Expand Down
2 changes: 0 additions & 2 deletions tests/Database.php → tests/Core/Utilities/Database.Test.php
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Database extends \PHPUnit_Framework_TestCase{

public function testQuery(){
Expand Down
2 changes: 0 additions & 2 deletions tests/Routes.php → tests/Core/Utilities/Routes.Test.php
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Routes extends \PHPUnit_Framework_TestCase{

public function testViewRequest(){
Expand Down
2 changes: 0 additions & 2 deletions tests/Session.php → tests/Core/Utilities/Session.Test.php
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Session extends \PHPUnit_Framework_TestCase{

public function testReadWrite(){
Expand Down
2 changes: 0 additions & 2 deletions tests/Views.php → tests/Core/Utilities/Views.Test.php
@@ -1,7 +1,5 @@
<?php

require_once sprintf('%s/index.php',dirname(__FILE__));

class Views extends \PHPUnit_Framework_TestCase{

public function testReplaceTag(){
Expand Down

0 comments on commit 13bc8fb

Please sign in to comment.