Skip to content

Commit 5fa9b57

Browse files
author
Luca Degasperi
committed
Adding test bench to test in a laravel-like environment
1 parent a3e80e5 commit 5fa9b57

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lucadegasperi/oauth2-server-laravel",
3-
"description": "A Laravel 4 wrapper for the popular OAuth 2.0 league/oauth2-server",
3+
"description": "A Laravel 4 wrapper for the popular OAuth 2.0 Server package league/oauth2-server",
44
"keywords": [
55
"laravel",
66
"oauth2",
@@ -22,11 +22,13 @@
2222
"phpunit/phpunit": "3.7.22",
2323
"mockery/mockery": ">=0.7.2",
2424
"league/phpunit-coverage-listener": "~1.0",
25-
"whatthejeff/nyancat-phpunit-resultprinter": "~1.1"
25+
"whatthejeff/nyancat-phpunit-resultprinter": "~1.1",
26+
"orchestra/testbench": "2.0.*"
2627
},
2728
"autoload": {
2829
"classmap": [
29-
"src/migrations"
30+
"src/migrations",
31+
"tests/TestCase.php"
3032
],
3133
"psr-0": {
3234
"LucaDegasperi\\OAuth2Server": "src/"

tests/OAuthFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use Mockery as m;
44

5-
class OAuthFilterTest extends PHPUnit_Framework_TestCase {
5+
class OAuthFilterTest extends TestCase {
66

77
public function test_filter_with_no_scope()
88
{

tests/TestCase.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
class TestCase extends Orchestra\Testbench\TestCase {
4+
5+
protected function getPackageProviders()
6+
{
7+
return array('LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider');
8+
}
9+
10+
protected function getPackageAliases()
11+
{
12+
return array(
13+
'AuthorizationServer' => 'LucaDegasperi\OAuth2Server\Facades\AuthorizationServerFacade',
14+
'ResourceServer' => 'LucaDegasperi\OAuth2Server\Facades\ResourceServerFacade',
15+
);
16+
}
17+
18+
}

0 commit comments

Comments
 (0)