Skip to content

Commit

Permalink
Merge pull request #1 from mateusjatenee/tests
Browse files Browse the repository at this point in the history
[WIP] basic tests setup
  • Loading branch information
Diego Hernandes authored Jun 29, 2017
2 parents 23dc661 + ebcc795 commit f195bf1
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: php

sudo: false

git:
depth: 2

matrix:
include:
- php: 7.0
- php: 7.1
- php: nightly
fast_finish: true

cache:
directories:
- $HOME/.composer/cache

before_script:
- phpenv config-rm xdebug.ini || true
- travis_retry composer self-update
- travis_retry composer install --no-interaction

script:
- composer test
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@
"Codecasts\\Auth\\JWT\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "stable",
"require": {
"php": ">=7.0.0",
"ext-openssl": "*",
"lcobucci/jwt": "^3.2",
"illuminate/support": ">=5.4.0"
},
"require-dev": {
"orchestra/testbench": "^3.4",
"phpunit/phpunit": "^6.1",
"mockery/mockery": "^0.9.9"
}
}
22 changes: 22 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
syntaxCheck="false">
<testsuites>
<testsuite name="LaravelJwt Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
10 changes: 10 additions & 0 deletions tests/Auth/GuardTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Tests\Auth\Guard;

use Tests\TestCase;

class GuardTest extends TestCase
{

}
13 changes: 13 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Tests;

use Codecasts\Auth\JWT\ServiceProvider;

class TestCase extends \Orchestra\Testbench\TestCase
{
public function getPackageProviders()
{
return [ServiceProvider::class, AuthService::class];
}
}

0 comments on commit f195bf1

Please sign in to comment.