Skip to content

Commit 12671a6

Browse files
Improved target test and added more badges
1 parent 8aaf04c commit 12671a6

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ before_install:
2525
install: composer install
2626

2727
script:
28-
- php vendor/bin/phpunit --coverage-text
28+
- vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
29+
30+
after_success:
31+
- bash <(curl -s https://codecov.io/bash)

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ Shooting Target
44
[![Build Status](https://travis-ci.org/patrickbussmann/shooting-target.svg?branch=master)](https://travis-ci.org/patrickbussmann/shooting-target)
55
[![Latest Stable Version](https://poser.pugx.org/patrickbussmann/shooting-target/v/stable.png)](https://packagist.org/packages/patrickbussmann/shooting-target)
66
[![Total Downloads](https://poser.pugx.org/patrickbussmann/shooting-target/downloads.png)](https://packagist.org/packages/patrickbussmann/shooting-target)
7-
87
[![StyleCI](https://styleci.io/repos/100169534/shield?branch=master)](https://styleci.io/repos/100169534)
8+
[![codecov.io](https://codecov.io/github/patrickbussmann/shooting-target/coverage.svg?branch=master)](https://codecov.io/github/patrickbussmann/shooting-target?branch=master)
9+
[![Coverage Status](https://coveralls.io/repos/github/patrickbussmann/shooting-target/badge.svg?branch=master)](https://coveralls.io/github/patrickbussmann/shooting-target?branch=master)
10+
911
The goal was it to display the hits from the [www.meyton.org/shooting-data-feed-sdf/](Meyton) system.
1012
The data source is called Shooting Data Feed (SDF) and could be a XML file or a MySQL database.
1113

tests/TargetTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ class TargetTest extends PHPUnit_Framework_TestCase
1515
*/
1616
public function testTargetConstruction()
1717
{
18-
$target = new Target();
18+
$hit = new Hit(10, 20);
19+
$target = new Target(1, 2, 3, 4, 5, [$hit]);
1920
$this->assertInstanceOf('ShootingTarget\\Target', $target);
21+
foreach ($target->getHits() as $hit) {
22+
$this->assertEquals(10, $hit->getX());
23+
$this->assertEquals(20, $hit->getY());
24+
}
2025
}
2126

2227
/**

0 commit comments

Comments
 (0)