Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from stefanzweifel/feature/add-coveralls
Browse files Browse the repository at this point in the history
Add Code Coverage through Coveralls
  • Loading branch information
stefanzweifel authored Sep 22, 2017
2 parents ecbb177 + 924f082 commit 121665f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ language: php
php:
- 7.0
- 7.1
- 7.2

before_script:
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --dev

script: phpunit

after_success:
- travis_retry php vendor/bin/coveralls
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Laravel DisableUpdatedAt Trait

[![Build Status](https://travis-ci.org/stefanzweifel/laravel-disable-updated-at.svg)](https://travis-ci.org/stefanzweifel/laravel-disable-updated-at)
[![Coverage Status](https://coveralls.io/repos/github/stefanzweifel/laravel-disable-updated-at/badge.svg?branch=feature%2Fadd-coveralls)](https://coveralls.io/github/stefanzweifel/laravel-disable-updated-at?branch=feature%2Fadd-coveralls)
[![StyleCI](https://styleci.io/repos/103444695/shield?branch=master)](https://styleci.io/repos/103444695)
[![Latest Stable Version](https://poser.pugx.org/wnx/laravel-disable-updated-at/v/stable)](https://packagist.org/packages/wnx/laravel-disable-updated-at)
[![Total Downloads](https://poser.pugx.org/wnx/laravel-disable-updated-at/downloads)](https://packagist.org/packages/wnx/laravel-disable-updated-at)
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"require-dev": {
"phpunit/phpunit": "6.*",
"orchestra/testbench": "~3.0",
"orchestra/database": "^3.5"
"orchestra/database": "^3.5",
"php-coveralls/php-coveralls": "^1.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
7 changes: 6 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/coverage.xml"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
</logging>
Expand Down
8 changes: 8 additions & 0 deletions tests/DisableUpdatedAtTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,12 @@ public function it_throws_an_exception_if_post_is_updated_but_does_not_have_an_u

$post->update(['content' => "I'm alive!"]);
}

/** @test */
public function it_returns_an_empty_string_for_updated_at_column()
{
$user = User::testStub();

$this->assertEquals('', $user->getUpdatedAtColumn());
}
}

0 comments on commit 121665f

Please sign in to comment.