From cea65c52fb5caf4f91fcf162557f289064f2fd69 Mon Sep 17 00:00:00 2001 From: Jeff Puckett Date: Sun, 24 Jul 2016 14:29:22 -0500 Subject: [PATCH 1/6] ignore credentials --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3fbe32e..6918ac7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor .DS_Store venv +credentials.local.inc.php From 52aecab66984bc30eeade28f436c19f126f4eb14 Mon Sep 17 00:00:00 2001 From: Jeff Puckett Date: Sun, 24 Jul 2016 14:43:45 -0500 Subject: [PATCH 2/6] add default coverage report --- coverage.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 coverage.xml diff --git a/coverage.xml b/coverage.xml new file mode 100644 index 0000000..a9fc44b --- /dev/null +++ b/coverage.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + From acd0b3b9d575c4fe04d8aa376caa24b4a0407dad Mon Sep 17 00:00:00 2001 From: Jeff Puckett Date: Sun, 24 Jul 2016 14:48:19 -0500 Subject: [PATCH 3/6] add parameter to test condition --- coverage.xml | 16 ++++++++-------- src/Example/Example.php | 6 +++--- tests/test.php | 9 ++++++++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/coverage.xml b/coverage.xml index a9fc44b..6275280 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,18 +1,18 @@ - - + + - + - - - + + + - + - + diff --git a/src/Example/Example.php b/src/Example/Example.php index afe89e0..10f30ed 100644 --- a/src/Example/Example.php +++ b/src/Example/Example.php @@ -2,13 +2,13 @@ class Example { - public static function go() + public static function go($bool = false) { - if (false) { + if ($bool) { return true; } return false; - + } } diff --git a/tests/test.php b/tests/test.php index d629843..48b1c5c 100644 --- a/tests/test.php +++ b/tests/test.php @@ -3,9 +3,16 @@ class Test extends PHPUnit_Framework_TestCase { + public function testExample() { $result = Example\Example::go(); } + + public function testExampleTrue() + { + $result = Example\Example::go(true); + } + } -?> +?> From 020fa0aaffe5b77789a2b9eb6ce52e478360f315 Mon Sep 17 00:00:00 2001 From: admonkey Date: Sun, 24 Jul 2016 14:57:59 -0500 Subject: [PATCH 4/6] Update README.md Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 54be14a..1dbcb61 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ Codecov PHP Example =================== +[![Build Status](https://travis-ci.org/admonkey/example-php.svg?branch=master)](https://travis-ci.org/admonkey/example-php) +[![Codecov](https://img.shields.io/codecov/c/github/admonkey/example-php.svg?maxAge=2592000)](https://codecov.io/gh/admonkey/example-php) +[![GitHub issues](https://img.shields.io/github/issues/admonkey/example-php.svg?maxAge=2592000)](https://github.com/admonkey/example-php/issues) | [https://codecov.io][1] | [@codecov][2] | [hello@codecov.io][3] | | ----------------------- | ------------- | --------------------- | From c214ba7f5624747610e086b7dc807ea112743cd4 Mon Sep 17 00:00:00 2001 From: Jeff Puckett Date: Sun, 24 Jul 2016 15:16:31 -0500 Subject: [PATCH 5/6] use assertions in empty tests --- coverage.xml | 4 ++-- tests/test.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coverage.xml b/coverage.xml index 6275280..1609b0f 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,6 +1,6 @@ - - + + diff --git a/tests/test.php b/tests/test.php index 48b1c5c..a92b497 100644 --- a/tests/test.php +++ b/tests/test.php @@ -6,12 +6,12 @@ class Test extends PHPUnit_Framework_TestCase public function testExample() { - $result = Example\Example::go(); + $this->assertFalse(Example\Example::go()); } public function testExampleTrue() { - $result = Example\Example::go(true); + $this->assertTrue(Example\Example::go(true)); } } From 2dffd9591ecc378389c1c6c1a5350adf8959463c Mon Sep 17 00:00:00 2001 From: Jeff Puckett Date: Sun, 24 Jul 2016 22:19:25 -0500 Subject: [PATCH 6/6] separate auto/manual tests and add dummy function --- .gitignore | 2 ++ coverage.xml | 18 ------------------ src/Example/Example.php | 8 ++++++-- test | 3 +++ 4 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 coverage.xml create mode 100755 test diff --git a/.gitignore b/.gitignore index 6918ac7..0cbfb28 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ vendor .DS_Store venv credentials.local.inc.php +html/ +coverage.xml diff --git a/coverage.xml b/coverage.xml deleted file mode 100644 index 1609b0f..0000000 --- a/coverage.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/Example/Example.php b/src/Example/Example.php index 10f30ed..8105ff2 100644 --- a/src/Example/Example.php +++ b/src/Example/Example.php @@ -2,13 +2,17 @@ class Example { - public static function go($bool = false) - { + public static function go($bool = false){ if ($bool) { return true; } return false; + } + public static function echoVar($var){ + $var += 1; + return $var; } + } diff --git a/test b/test new file mode 100755 index 0000000..9aff815 --- /dev/null +++ b/test @@ -0,0 +1,3 @@ +#!/bin/bash +vendor/bin/phpunit --coverage-html=html +php -S localhost:8080 -t html/