Skip to content

Commit 6032a9b

Browse files
committed
Merge remote-tracking branch 'origin/develop' into request-validation
2 parents b8e2b5a + 4339762 commit 6032a9b

17 files changed

+74
-31
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"autoload-dev": {
4646
"psr-4": {
47-
"Huntie\\JsonApi\\Tests\\": "tests/"
47+
"Tests\\": "tests/"
4848
}
4949
}
5050
}

tests/Support/JsonApiAssertions.php renamed to src/Testing/JsonApiAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Support;
3+
namespace Huntie\JsonApi\Testing;
44

55
/**
66
* Extend TestCase with additional JSON API related assertions.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Tests\Fixtures\Controllers;
4+
5+
use Huntie\JsonApi\Http\Controllers\JsonApiController;
6+
use Huntie\JsonApi\Http\Controllers\JsonApiControllerActions;
7+
use Tests\Fixtures\Models\User;
8+
9+
class UserController extends JsonApiController
10+
{
11+
use JsonApiControllerActions;
12+
13+
/**
14+
* Return the related Eloquent Model.
15+
*
16+
* @return Model
17+
*/
18+
public function getModel()
19+
{
20+
return new User();
21+
}
22+
}

tests/Fixtures/Models/Comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Fixtures\Models;
3+
namespace Tests\Fixtures\Models;
44

55
class Comment extends Model
66
{

tests/Fixtures/Models/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Fixtures\Models;
3+
namespace Tests\Fixtures\Models;
44

55
use Illuminate\Database\Eloquent\Model as Eloquent;
66

tests/Fixtures/Models/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Fixtures\Models;
3+
namespace Tests\Fixtures\Models;
44

55
use Huntie\JsonApi\Contracts\Model\IncludesRelatedResources;
66

tests/Fixtures/Models/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Fixtures\Models;
3+
namespace Tests\Fixtures\Models;
44

55
class Tag extends Model
66
{

tests/Fixtures/Models/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Fixtures\Models;
3+
namespace Tests\Fixtures\Models;
44

55
use Huntie\JsonApi\Contracts\Model\IncludesRelatedResources;
66

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Tests\Fixtures\Routes;
4+
5+
use Tests\Fixtures\Controllers\UserController;
6+
7+
/**
8+
* Define example application routes for testing.
9+
*/
10+
trait ExampleRoutes
11+
{
12+
/**
13+
* Define environment setup.
14+
*
15+
* @param \Illuminate\Foundation\Application $app
16+
*/
17+
public function getEnvironmentSetup($app)
18+
{
19+
$app['router']->resource('users', UserController::class);
20+
}
21+
}

tests/Serializers/CollectionSerializerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Serializers;
3+
namespace Tests\Serializers;
44

55
use Illuminate\Pagination\LengthAwarePaginator;
66
use Illuminate\Support\Collection;
77
use Huntie\JsonApi\Serializers\CollectionSerializer;
8-
use Huntie\JsonApi\Tests\TestCase;
9-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
8+
use Tests\TestCase;
9+
use Tests\Fixtures\Models\User;
1010

1111
class CollectionSerializerTest extends TestCase
1212
{

tests/Serializers/JsonApiSerializerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Serializers;
3+
namespace Tests\Serializers;
44

55
use Huntie\JsonApi\Serializers\ResourceSerializer;
6-
use Huntie\JsonApi\Tests\TestCase;
7-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
6+
use Tests\TestCase;
7+
use Tests\Fixtures\Models\User;
88

99
class JsonApiSerializerTest extends TestCase
1010
{

tests/Serializers/RelationshipSerializerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Serializers;
3+
namespace Tests\Serializers;
44

55
use Huntie\JsonApi\Serializers\RelationshipSerializer;
6-
use Huntie\JsonApi\Tests\TestCase;
7-
use Huntie\JsonApi\Tests\Fixtures\Models\Post;
8-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
6+
use Tests\TestCase;
7+
use Tests\Fixtures\Models\Post;
8+
use Tests\Fixtures\Models\User;
99

1010
class RelationshipSerializerTest extends TestCase
1111
{

tests/Serializers/ResourceSerializerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests\Serializers;
3+
namespace Tests\Serializers;
44

55
use Huntie\JsonApi\Serializers\ResourceSerializer;
6-
use Huntie\JsonApi\Tests\TestCase;
7-
use Huntie\JsonApi\Tests\Fixtures\Models\Post;
8-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
6+
use Tests\TestCase;
7+
use Tests\Fixtures\Models\Post;
8+
use Tests\Fixtures\Models\User;
99
use Illuminate\Support\Collection;
1010

1111
class ResourceSerializerTest extends TestCase

tests/Support/Factories/CommentFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use Faker\Generator;
4-
use Huntie\JsonApi\Tests\Fixtures\Models\Comment;
5-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
4+
use Tests\Fixtures\Models\Comment;
5+
use Tests\Fixtures\Models\User;
66

77
$factory->define(Comment::class, function (Generator $faker) {
88
return [

tests/Support/Factories/PostFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33
use Faker\Generator;
4-
use Huntie\JsonApi\Tests\Fixtures\Models\Comment;
5-
use Huntie\JsonApi\Tests\Fixtures\Models\Post;
6-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
4+
use Tests\Fixtures\Models\Comment;
5+
use Tests\Fixtures\Models\Post;
6+
use Tests\Fixtures\Models\User;
77

88
$factory->define(Post::class, function (Generator $faker) {
99
return [

tests/Support/Factories/UserFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33
use Faker\Generator;
4-
use Huntie\JsonApi\Tests\Fixtures\Models\Comment;
5-
use Huntie\JsonApi\Tests\Fixtures\Models\Post;
6-
use Huntie\JsonApi\Tests\Fixtures\Models\User;
4+
use Tests\Fixtures\Models\Comment;
5+
use Tests\Fixtures\Models\Post;
6+
use Tests\Fixtures\Models\User;
77

88
$factory->define(User::class, function (Generator $faker) {
99
return [

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace Huntie\JsonApi\Tests;
3+
namespace Tests;
44

5-
use Huntie\JsonApi\Tests\Support\JsonApiAssertions;
5+
use Huntie\JsonApi\Testing\JsonApiAssertions;
66

77
abstract class TestCase extends \Orchestra\Testbench\TestCase
88
{

0 commit comments

Comments
 (0)