Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4397 from DASPRiD/feature/coveralls-support
Browse files Browse the repository at this point in the history
Add coveralls support and fix a few testing bugs related to coverage
  • Loading branch information
weierophinney committed Jun 28, 2013
2 parents d982e34 + 43e9a61 commit ba47da9
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
@@ -0,0 +1,2 @@
src_dir: library

3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -16,6 +16,9 @@ before_install:
script:
- ant travis -keep-going

after_script:
- php vendor/bin/coveralls

notifications:
irc: "irc.freenode.org#zftalk.dev"
email: false
8 changes: 6 additions & 2 deletions README.md
@@ -1,7 +1,11 @@
### Welcome to the *Zend Framework 2.3* Release!

Master: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=master)](http://travis-ci.org/zendframework/zf2)
Develop: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=develop)](http://travis-ci.org/zendframework/zf2)
Master:
[![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=master)](http://travis-ci.org/zendframework/zf2)
[![Coverage Status](https://coveralls.io/repos/zendframework/zf2/badge.png?branch=master)](https://coveralls.io/r/zendframework/zf2)
Develop:
[![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=develop)](http://travis-ci.org/zendframework/zf2)
[![Coverage Status](https://coveralls.io/repos/zendframework/zf2/badge.png?branch=develop)](https://coveralls.io/r/zendframework/zf2)

## RELEASE INFORMATION

Expand Down
22 changes: 21 additions & 1 deletion build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ZF2" default="build">
<target name="travis" depends="tests-parallel,show-test-results" />
<target name="travis" depends="tests-parallel,merge-clover,show-test-results" />

<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build"/>
Expand All @@ -9,6 +9,8 @@
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/test-results"/>
<mkdir dir="${basedir}/build/cs-results"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
</target>

<target name="get-cs-fixer" depends="clean" description="Get coding standards fixer">
Expand All @@ -32,6 +34,22 @@
</sequential>
</target>

<target name="merge-clover" description="Merges the individual clover reports of each component into a single clover.xml">
<sequential>
<exec executable="php" failonerror="true">
<arg value="-d" />
<arg value="memory_limit=-1" />
<arg value="vendor/bin/phpcov.php" />
<arg value="--merge" />
<arg value="--clover" />
<arg value="${basedir}/build/logs/clover.xml" />
<arg value="--whitelist" />
<arg value="${basedir}/library" />
<arg value="${basedir}/build/coverage" />
</exec>
</sequential>
</target>

<target
name="tests-parallel"
depends="prepare,composer-install,get-cs-fixer"
Expand Down Expand Up @@ -119,6 +137,8 @@
>
<arg value="-c" />
<arg value="${basedir}/tests/phpunit.xml.dist" />
<arg value="--coverage-php" />
<arg value="${basedir}/build/coverage/coverage-@{component}.cov" />
<arg value="${basedir}/tests/ZendTest/@{component}" />
</exec>
</sequential>
Expand Down
25 changes: 24 additions & 1 deletion composer.json
Expand Up @@ -8,6 +8,27 @@
],
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"repositories": [
{
"type": "package",
"package": {
"name": "sebastianbergmann/phpcov",
"version": "1.1.0",
"dist": {
"url": "https://github.com/sebastianbergmann/phpcov/archive/1.1.0.zip",
"type": "zip"
},
"source": {
"url": "https://github.com/sebastianbergmann/phpcov.git",
"type": "git",
"reference": "1.1.0"
},
"bin": [
"phpcov.php"
]
}
}
],
"require": {
"php": ">=5.3.3"
},
Expand All @@ -16,7 +37,9 @@
"ircmaxell/random-lib": "dev-master",
"ircmaxell/security-lib": "dev-master",
"ocramius/proxy-manager": "0.3.*",
"phpunit/PHPUnit": "3.7.*"
"phpunit/PHPUnit": "3.7.*",
"satooshi/php-coveralls": "dev-master",
"sebastianbergmann/phpcov": "1.1.0"
},
"suggest": {
"ext-intl": "ext/intl for i18n features (included in default builds of PHP)",
Expand Down
6 changes: 3 additions & 3 deletions tests/ZendTest/Http/Header/AcceptTest.php
Expand Up @@ -282,7 +282,7 @@ public function testWildcardWithDifferentParamsAndRanges()

/**
* @group 3739
* @covers Accept::matchAcceptParams()
* @covers Zend\Http\Header\AbstractAccept::matchAcceptParams()
*/
public function testParamRangesWithDecimals()
{
Expand All @@ -293,8 +293,8 @@ public function testParamRangesWithDecimals()
/**
* @group 3740
* @dataProvider provideParamRanges
* @covers Accept::matchAcceptParams()
* @covers Accept::getParametersFromFieldValuePart()
* @covers Zend\Http\Header\AbstractAccept::matchAcceptParams()
* @covers Zend\Http\Header\AbstractAccept::getParametersFromFieldValuePart()
*/
public function testParamRangesSupportDevStage($range, $input, $success)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/ZendTest/Mvc/Controller/ControllerManagerTest.php
Expand Up @@ -62,8 +62,8 @@ public function testInjectControllerDependenciesWillNotOverwriteExistingEventMan
}

/**
* @covers ControllerManager::has
* @covers ControllerManager::get
* @covers Zend\ServiceManager\ServiceManager::has
* @covers Zend\ServiceManager\AbstractPluginManager::get
*/
public function testDoNotUsePeeringServiceManagers()
{
Expand Down
5 changes: 5 additions & 0 deletions tests/ZendTest/Validator/File/IsCompressedTest.php
Expand Up @@ -33,6 +33,11 @@ protected function getMagicMime()
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

// Ubuntu has backported the changes in 12.04 to PHP 5.3.10.
if (strpos(PHP_VERSION, 'ubuntu') !== false && version_compare(PHP_VERSION, '5.3.10', '>=')) {
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

return __DIR__ . '/_files/magic.mime';
}

Expand Down
5 changes: 5 additions & 0 deletions tests/ZendTest/Validator/File/IsImageTest.php
Expand Up @@ -31,6 +31,11 @@ protected function getMagicMime()
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

// Ubuntu has backported the changes in 12.04 to PHP 5.3.10.
if (strpos(PHP_VERSION, 'ubuntu') !== false && version_compare(PHP_VERSION, '5.3.10', '>=')) {
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

return __DIR__ . '/_files/magic.mime';
}

Expand Down

0 comments on commit ba47da9

Please sign in to comment.