Skip to content

Commit f195bf1

Browse files
author
Diego Hernandes
authored
Merge pull request #1 from mateusjatenee/tests
[WIP] basic tests setup
2 parents 23dc661 + ebcc795 commit f195bf1

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: php
2+
3+
sudo: false
4+
5+
git:
6+
depth: 2
7+
8+
matrix:
9+
include:
10+
- php: 7.0
11+
- php: 7.1
12+
- php: nightly
13+
fast_finish: true
14+
15+
cache:
16+
directories:
17+
- $HOME/.composer/cache
18+
19+
before_script:
20+
- phpenv config-rm xdebug.ini || true
21+
- travis_retry composer self-update
22+
- travis_retry composer install --no-interaction
23+
24+
script:
25+
- composer test

composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@
1414
"Codecasts\\Auth\\JWT\\": "src/"
1515
}
1616
},
17+
"autoload-dev": {
18+
"psr-4": {
19+
"Tests\\": "tests/"
20+
}
21+
},
1722
"minimum-stability": "stable",
1823
"require": {
1924
"php": ">=7.0.0",
2025
"ext-openssl": "*",
2126
"lcobucci/jwt": "^3.2",
2227
"illuminate/support": ">=5.4.0"
28+
},
29+
"require-dev": {
30+
"orchestra/testbench": "^3.4",
31+
"phpunit/phpunit": "^6.1",
32+
"mockery/mockery": "^0.9.9"
2333
}
2434
}

phpunit.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="true"
11+
syntaxCheck="false">
12+
<testsuites>
13+
<testsuite name="LaravelJwt Test Suite">
14+
<directory>tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>

tests/Auth/GuardTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Tests\Auth\Guard;
4+
5+
use Tests\TestCase;
6+
7+
class GuardTest extends TestCase
8+
{
9+
10+
}

tests/TestCase.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
use Codecasts\Auth\JWT\ServiceProvider;
6+
7+
class TestCase extends \Orchestra\Testbench\TestCase
8+
{
9+
public function getPackageProviders()
10+
{
11+
return [ServiceProvider::class, AuthService::class];
12+
}
13+
}

0 commit comments

Comments
 (0)