Repository: swisnl/json-api-client (php)

Issue:
Use illuminate/collections and split Laravel parts to json-api-client-laravel
<!-- Provide a general summary of the issue in the Title above -->

## Detailed description

Laravel collections [illuminate/collections](https://packagist.org/packages/illuminate/collections) have been split into a separate package. Besides that we only use some array and string helpers in the framework agnostic parts of this package. We can extract the Laravel parts to a new package called json-api-client-laravel and drop the [illuminate/support](https://packagist.org/packages/illuminate/support) dependency.

## Context

It is considered a bad practice to use illuminate/support in a framework agnostic package due to it's heavy weight and dependencies: https://mattallan.me/posts/dont-use-illuminate-support/. Besides that it will allow us to make it more clear how to use it with or without Laravel.

## Possible implementation

This will obviously be a breaking change and should be considered for a 2.0 release.


Pull request description:
Remove Laravel parts
<!--- Provide a general summary of your changes in the Title above -->

## Description

I've extracted the Laravel parts (config, service provider and facades) into [swisnl/json-api-client-laravel](https://github.com/swisnl/json-api-client-laravel).

## Motivation and context

Closes #80 

## How has this been tested?

Tested with existing unit tests.

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

Go over all the following points, and put an `x` in all the boxes that apply.

- [x] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [x] My pull request addresses exactly one patch/feature.
- [x] I have created a branch for this patch/feature.
- [x] Each individual commit in the pull request is meaningful.
- [x] I have added tests to cover my changes.
- [x] If my change requires a change to the documentation, I have updated it accordingly.


Patch:
diff --git a/.php_cs.dist b/.php_cs.dist
index 82aacef..6fb04d4 100644
--- a/.php_cs.dist
+++ b/.php_cs.dist
@@ -2,7 +2,6 @@
 
 $finder = PhpCsFixer\Finder::create()
     ->in([
-        __DIR__.'/config',
         __DIR__.'/src',
         __DIR__.'/tests'
     ])
diff --git a/.travis.yml b/.travis.yml
index 3901bb6..64eb224 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,7 +12,7 @@ matrix:
 sudo: false
 
 install:
-  - composer require "illuminate/support:${LARAVEL_VERSION}" --no-update --no-interaction
+  - composer require "illuminate/contracts:${LARAVEL_VERSION}" "swisnl/illuminate-collections:${LARAVEL_VERSION}" --no-update --no-interaction
   - travis_retry composer install --no-interaction --prefer-dist
 
 script:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7524c96..8f3dcfb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 * Removed Laravel <6 and PHP <7.2 support.
 * Removed `jenssegers/model` dependency and added the classes into the package.
+* Extracted Laravel parts (config, service provider and facades) into [swisnl/json-api-client-laravel](https://github.com/swisnl/json-api-client-laravel).
 
 ## [1.3.3] - 2021-01-18
 
diff --git a/README.MD b/README.MD
index 7d991bc..2ff721a 100644
--- a/README.MD
+++ b/README.MD
@@ -15,6 +15,8 @@ A PHP package for mapping remote [JSON:API](http://jsonapi.org/) resources to El
 
 ## Installation
 
+:information_source: Using Laravel? Take a look at [swisnl/json-api-client-laravel](https://github.com/swisnl/json-api-client-laravel) for easy Laravel integration.
+
 ``` bash
 composer require swisnl/json-api-client
 ```
@@ -31,57 +33,7 @@ To use Guzzle 7, for example, simply require `guzzlehttp/guzzle`:
 composer require guzzlehttp/guzzle:^7.0
 ```
 
-See [Bind clients](#bind-clients) if you want to use your own HTTP client or use specific configuration options.
-
-### Laravel
-
-This package includes some Laravel specific classes to make it easier to use it with Laravel.
-
-#### Service Provider and Facade Aliases
-
-The required service provider and some facade aliases are automatically discovered by Laravel.
-However, if you've disabled package auto discover, you must add the service provider and optionally the facade aliases to your `config/app.php` file:
-
-``` php
-'providers' => [
-    ...,
-    \Swis\JsonApi\Client\Providers\ServiceProvider::class,
-],
-'aliases' => [
-    ...,
-    'DocumentFactory' => \Swis\JsonApi\Client\Facades\DocumentFactoryFacade::class,
-    'DocumentParser' => \Swis\JsonApi\Client\Facades\DocumentParserFacade::class,
-    'ItemHydrator' => \Swis\JsonApi\Client\Facades\ItemHydratorFacade::class,
-    'ResponseParser' => \Swis\JsonApi\Client\Facades\ResponseParserFacade::class,
-    'TypeMapper' => \Swis\JsonApi\Client\Facades\TypeMapperFacade::class,
-],
-```
-
-#### Configuration
-
-The following is the default configuration provided by this package:
-
-``` php
-return [
-    /*
-    |--------------------------------------------------------------------------
-    | Base URI
-    |--------------------------------------------------------------------------
-    |
-    | Specify a base uri which will be prepended to every URI.
-    |
-    | Default: empty string
-    |
-    */
-    'base_uri' => '',
-];
-```
-        
-If you would like to make changes to the default configuration, publish and edit the configuration file:
-
-``` bash
-php artisan vendor:publish --provider="Swis\JsonApi\Client\Providers\ServiceProvider" --tag="config"
-```
+See [HTTP Clients](#http-clients) if you want to use your own HTTP client or use specific configuration options.
 
 
 ## Getting started
@@ -288,28 +240,6 @@ echo $meta->written_at; // 2019-07-16T13:47:26
 All custom models must be registered with the `TypeMapper`.
 This `TypeMapper` maps, as the name suggests, JSON:API types to custom [items](#items).
 
-### Mapping types
-
-You can manually register items with the `\Swis\JsonApi\Client\TypeMapper` or use the supplied `\Swis\JsonApi\Client\Providers\TypeMapperServiceProvider`:
-
-``` php
-use Swis\JsonApi\Client\Providers\TypeMapperServiceProvider as BaseTypeMapperServiceProvider;
-
-class TypeMapperServiceProvider extends BaseTypeMapperServiceProvider
-{
-    /**
-     * A list of class names implementing \Swis\JsonApi\Client\Interfaces\ItemInterface.
-     *
-     * @var string[]
-     */
-    protected $items = [
-        \App\Items\Author::class,
-        \App\Items\Blog::class,
-        \App\Items\Comment::class,
-    ];
-}
-```
-
 
 ## Repository
 
@@ -343,9 +273,9 @@ The `ItemHydrator` can be used to fill/hydrate an item and its relations using a
 This is useful if you would like to hydrate an item with POST data from your request:
 
 ``` php
-$typeMapper = app(Swis\JsonApi\Client\TypeMapper::class);
-$itemHydrator = app(Swis\JsonApi\Client\ItemHydrator::class);
-$blogRepository = app(App\Repositiories\BlogRepository::class);
+$typeMapper = new TypeMapper();
+$itemHydrator = new ItemHydrator($typeMapper);
+$blogRepository = new BlogRepository(DocumentClient::create($typeMapper), new DocumentFactory());
 
 $item = $itemHydrator->hydrate(
     $typeMapper->getMapping('blog'),
@@ -502,45 +432,29 @@ Such documents can easily be created using the `DocumentFactory` by giving it a
 This can be an `ItemInterface`, usually created by the [ItemHydrator](#itemhydrator), or a `Collection`.
 
 
-## Service Provider
-
-The `\Swis\JsonApi\Client\Providers\ServiceProvider` registers the `TypeMapper`, `JsonApi\Parser` and both clients; `Client` and `DocumentClient`.
-Each section can be overwritten to allow extended customization.
-
-### Bind TypeMapper
+## HTTP Clients
 
-The service provider registers the `TypeMapper` as a singleton so your entire application has the same mappings available.
-
-### Bind Clients
-
-The service provider registers the `Client` and `DocumentClient` to your application.
 By default the `Client` uses [php-http/discovery](https://github.com/php-http/discovery) to find an available HTTP client, request factory and stream factory so you don't have to setup those yourself.
-You can specify your own HTTP client, request factory or stream factory by customizing the container binding.
+You can also specify your own HTTP client, request factory or stream factory.
 This is a perfect way to add extra options to your HTTP client or register a mock HTTP client for your tests:
 
 ``` php
-class ServiceProvider extends \Illuminate\Support\ServiceProvider
-{
-    public function register()
-    {
-        $this->app->bind(\Swis\JsonApi\Client\Client::class, function ($app) {
-            if ($app->environment('testing')) {
-                $httpClient = new \Swis\Http\Fixture\Client(
-                    new \Swis\Http\Fixture\ResponseBuilder('/path/to/fixtures')
-                );
-            } else {
-                $httpClient = new \GuzzleHttp\Client(
-                    [
-                        'http_errors' => false,
-                        'timeout' => 2,
-                    ]
-                );
-            }
-    
-            return new \Swis\JsonApi\Client\Client($httpClient);
-        });
-    }
+if (app()->environment('testing')) {
+    $httpClient = new \Swis\Http\Fixture\Client(
+        new \Swis\Http\Fixture\ResponseBuilder('/path/to/fixtures')
+    );
+} else {
+    $httpClient = new \GuzzleHttp\Client(
+        [
+            'http_errors' => false,
+            'timeout' => 2,
+        ]
+    );
 }
+
+$typeMapper = new TypeMapper();
+$client = DocumentClient::create($typeMapper, $httpClient);
+$document = $client->get('https://cms.contentacms.io/api/recipes');
 ```
 
 N.B. This example uses our [swisnl/php-http-fixture-client](https://github.com/swisnl/php-http-fixture-client) when in testing environment.
diff --git a/composer.json b/composer.json
index ce3f35a..3594643 100644
--- a/composer.json
+++ b/composer.json
@@ -5,18 +5,18 @@
     "require": {
         "php": ">=7.2.5",
         "ext-json": "*",
-        "illuminate/support": "^6.0|^7.0|^8.0",
+        "illuminate/contracts": "^6.0|^7.0|^8.0",
         "nyholm/psr7": "^1.2",
         "php-http/discovery": "^1.0",
         "psr/http-client": "^1.0",
         "psr/http-client-implementation": "^1.0",
         "psr/http-factory": "^1.0",
         "psr/http-factory-implementation": "^1.0",
-        "psr/http-message": "^1.0"
+        "psr/http-message": "^1.0",
+        "swisnl/illuminate-collections": "^6.0|^7.0|^8.0"
     },
     "require-dev": {
         "friendsofphp/php-cs-fixer": "^2.16",
-        "graham-campbell/testbench": "^5.5",
         "phpunit/phpunit": "^6.5|^7.0|^8.0",
         "php-http/guzzle6-adapter": "^2.0",
         "php-http/mock-client": "^1.2"
@@ -58,18 +58,6 @@
     "extra": {
         "branch-alias": {
             "dev-master": "2.0.x-dev"
-        },
-        "laravel": {
-            "providers": [
-                "Swis\\JsonApi\\Client\\Providers\\ServiceProvider"
-            ],
-            "aliases":{
-                "DocumentFactory": "Swis\\JsonApi\\Client\\Facades\\DocumentFactoryFacade",
-                "DocumentParser": "Swis\\JsonApi\\Client\\Facades\\DocumentParserFacade",
-                "ItemHydrator": "Swis\\JsonApi\\Client\\Facades\\ItemHydratorFacade",
-                "ResponseParser": "Swis\\JsonApi\\Client\\Facades\\ResponseParserFacade",
-                "TypeMapper": "Swis\\JsonApi\\Client\\Facades\\TypeMapperFacade"
-            }
         }
     }
 }
diff --git a/config/jsonapi.php b/config/jsonapi.php
deleted file mode 100644
index 5df8d1a..0000000
--- a/config/jsonapi.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-return [
-    /*
-    |--------------------------------------------------------------------------
-    | Base URI
-    |--------------------------------------------------------------------------
-    |
-    | Specify a base uri which will be prepended to every URI.
-    |
-    | Default: empty string
-    |
-    */
-    'base_uri' => '',
-];
diff --git a/src/Facades/DocumentFactoryFacade.php b/src/Facades/DocumentFactoryFacade.php
deleted file mode 100644
index f7d2730..0000000
--- a/src/Facades/DocumentFactoryFacade.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Facades;
-
-use Illuminate\Support\Facades\Facade;
-use Swis\JsonApi\Client\DocumentFactory;
-
-/**
- * @method static \Swis\JsonApi\Client\ItemDocument|\Swis\JsonApi\Client\CollectionDocument make(\Swis\JsonApi\Client\Interfaces\DataInterface $data)
- *
- * @see \Swis\JsonApi\Client\DocumentFactory
- */
-class DocumentFactoryFacade extends Facade
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected static function getFacadeAccessor()
-    {
-        return DocumentFactory::class;
-    }
-}
diff --git a/src/Facades/DocumentParserFacade.php b/src/Facades/DocumentParserFacade.php
deleted file mode 100644
index edc2860..0000000
--- a/src/Facades/DocumentParserFacade.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Facades;
-
-use Illuminate\Support\Facades\Facade;
-use Swis\JsonApi\Client\Interfaces\DocumentParserInterface;
-
-/**
- * @method static \Swis\JsonApi\Client\Interfaces\DocumentInterface parse(string $json)
- *
- * @see \Swis\JsonApi\Client\Interfaces\DocumentParserInterface
- */
-class DocumentParserFacade extends Facade
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected static function getFacadeAccessor()
-    {
-        return DocumentParserInterface::class;
-    }
-}
diff --git a/src/Facades/ItemHydratorFacade.php b/src/Facades/ItemHydratorFacade.php
deleted file mode 100644
index 2267349..0000000
--- a/src/Facades/ItemHydratorFacade.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Facades;
-
-use Illuminate\Support\Facades\Facade;
-use Swis\JsonApi\Client\ItemHydrator;
-
-/**
- * @method static \Swis\JsonApi\Client\Interfaces\ItemInterface hydrate(\Swis\JsonApi\Client\Interfaces\ItemInterface $item, array $attributes, string $id = null)
- *
- * @see \Swis\JsonApi\Client\ItemHydrator
- */
-class ItemHydratorFacade extends Facade
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected static function getFacadeAccessor()
-    {
-        return ItemHydrator::class;
-    }
-}
diff --git a/src/Facades/ResponseParserFacade.php b/src/Facades/ResponseParserFacade.php
deleted file mode 100644
index ba22f3d..0000000
--- a/src/Facades/ResponseParserFacade.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Facades;
-
-use Illuminate\Support\Facades\Facade;
-use Swis\JsonApi\Client\Interfaces\ResponseParserInterface;
-
-/**
- * @method static \Swis\JsonApi\Client\Interfaces\DocumentInterface parse(\Psr\Http\Message\ResponseInterface $response)
- *
- * @see \Swis\JsonApi\Client\Interfaces\ResponseParserInterface
- */
-class ResponseParserFacade extends Facade
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected static function getFacadeAccessor()
-    {
-        return ResponseParserInterface::class;
-    }
-}
diff --git a/src/Facades/TypeMapperFacade.php b/src/Facades/TypeMapperFacade.php
deleted file mode 100644
index 82eba2b..0000000
--- a/src/Facades/TypeMapperFacade.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Facades;
-
-use Illuminate\Support\Facades\Facade;
-use Swis\JsonApi\Client\Interfaces\TypeMapperInterface;
-
-/**
- * @method static void setMapping(string $type, string $class)
- * @method static bool hasMapping(string $type)
- * @method static void removeMapping(string $type)
- * @method static \Swis\JsonApi\Client\Interfaces\ItemInterface getMapping(string $type)
- *
- * @see \Swis\JsonApi\Client\Interfaces\TypeMapperInterface
- */
-class TypeMapperFacade extends Facade
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected static function getFacadeAccessor()
-    {
-        return TypeMapperInterface::class;
-    }
-}
diff --git a/src/Providers/ServiceProvider.php b/src/Providers/ServiceProvider.php
deleted file mode 100644
index 6d80bbc..0000000
--- a/src/Providers/ServiceProvider.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Providers;
-
-use Illuminate\Support\ServiceProvider as BaseServiceProvider;
-use Swis\JsonApi\Client\Client;
-use Swis\JsonApi\Client\DocumentClient;
-use Swis\JsonApi\Client\Interfaces\ClientInterface;
-use Swis\JsonApi\Client\Interfaces\DocumentClientInterface;
-use Swis\JsonApi\Client\Interfaces\DocumentParserInterface;
-use Swis\JsonApi\Client\Interfaces\ResponseParserInterface;
-use Swis\JsonApi\Client\Interfaces\TypeMapperInterface;
-use Swis\JsonApi\Client\Parsers\DocumentParser;
-use Swis\JsonApi\Client\Parsers\ResponseParser;
-use Swis\JsonApi\Client\TypeMapper;
-
-class ServiceProvider extends BaseServiceProvider
-{
-    public function register()
-    {
-        $this->mergeConfigFrom(
-            dirname(__DIR__, 2).'/config/jsonapi.php',
-            'jsonapi'
-        );
-
-        $this->registerSharedTypeMapper();
-        $this->registerParsers();
-        $this->registerClients();
-    }
-
-    public function boot()
-    {
-        $this->publishes([
-            dirname(__DIR__, 2).'/config/' => config_path(),
-        ], 'config');
-    }
-
-    protected function registerSharedTypeMapper()
-    {
-        $this->app->bind(TypeMapperInterface::class, TypeMapper::class);
-        $this->app->singleton(TypeMapper::class);
-    }
-
-    protected function registerParsers()
-    {
-        $this->app->bind(DocumentParserInterface::class, DocumentParser::class);
-        $this->app->bind(ResponseParserInterface::class, ResponseParser::class);
-    }
-
-    protected function registerClients()
-    {
-        $this->app->extend(
-            ClientInterface::class,
-            static function (ClientInterface $client) {
-                if ($baseUri = config('jsonapi.base_uri')) {
-                    $client->setBaseUri($baseUri);
-                }
-
-                return $client;
-            }
-        );
-
-        $this->app->bind(ClientInterface::class, Client::class);
-        $this->app->bind(DocumentClientInterface::class, DocumentClient::class);
-    }
-}
diff --git a/src/Providers/TypeMapperServiceProvider.php b/src/Providers/TypeMapperServiceProvider.php
deleted file mode 100644
index 03422fa..0000000
--- a/src/Providers/TypeMapperServiceProvider.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Providers;
-
-use Illuminate\Support\ServiceProvider as BaseServiceProvider;
-use Swis\JsonApi\Client\Interfaces\TypeMapperInterface;
-
-class TypeMapperServiceProvider extends BaseServiceProvider
-{
-    /**
-     * A list of class names implementing \Swis\JsonApi\Client\Interfaces\ItemInterface.
-     *
-     * @var string[]
-     */
-    protected $items = [];
-
-    /**
-     * @param \Swis\JsonApi\Client\Interfaces\TypeMapperInterface $typeMapper
-     */
-    public function boot(TypeMapperInterface $typeMapper)
-    {
-        foreach ($this->items as $class) {
-            /** @var \Swis\JsonApi\Client\Interfaces\ItemInterface $item */
-            $item = $this->app->make($class);
-
-            $typeMapper->setMapping($item->getType(), $class);
-        }
-    }
-}


Test patch:
diff --git a/tests/AbstractTest.php b/tests/AbstractTest.php
deleted file mode 100644
index 700d2b3..0000000
--- a/tests/AbstractTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Tests;
-
-use Orchestra\Testbench\TestCase;
-
-abstract class AbstractTest extends TestCase
-{
-    /**
-     * Define environment setup.
-     *
-     * @param \Illuminate\Foundation\Application $app
-     */
-    protected function getEnvironmentSetUp($app)
-    {
-        // Import default settings
-        $defaultSettings = require __DIR__.'/../config/jsonapi.php';
-        $app['config']->set('jsonapi', $defaultSettings);
-    }
-
-    protected function getPackageProviders($app)
-    {
-        return [];
-    }
-}
diff --git a/tests/ClientTest.php b/tests/ClientTest.php
index 1a12a8c..22a6c4b 100644
--- a/tests/ClientTest.php
+++ b/tests/ClientTest.php
@@ -4,10 +4,11 @@ namespace Swis\JsonApi\Client\Tests;
 
 use function GuzzleHttp\Psr7\stream_for;
 use Http\Mock\Client as HttpMockClient;
+use PHPUnit\Framework\TestCase;
 use Psr\Http\Message\ResponseInterface;
 use Swis\JsonApi\Client\Client;
 
-class ClientTest extends AbstractTest
+class ClientTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/DocumentClientTest.php b/tests/DocumentClientTest.php
index 8740260..d5ed505 100644
--- a/tests/DocumentClientTest.php
+++ b/tests/DocumentClientTest.php
@@ -2,6 +2,7 @@
 
 namespace Swis\JsonApi\Client\Tests;
 
+use PHPUnit\Framework\TestCase;
 use Psr\Http\Message\ResponseInterface;
 use Swis\JsonApi\Client\Document;
 use Swis\JsonApi\Client\DocumentClient;
@@ -10,7 +11,7 @@ use Swis\JsonApi\Client\Interfaces\ResponseParserInterface;
 use Swis\JsonApi\Client\Item;
 use Swis\JsonApi\Client\ItemDocument;
 
-class DocumentClientTest extends AbstractTest
+class DocumentClientTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/DocumentFactoryTest.php b/tests/DocumentFactoryTest.php
index 00f18f3..510ab68 100644
--- a/tests/DocumentFactoryTest.php
+++ b/tests/DocumentFactoryTest.php
@@ -2,13 +2,14 @@
 
 namespace Swis\JsonApi\Client\Tests;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Collection;
 use Swis\JsonApi\Client\CollectionDocument;
 use Swis\JsonApi\Client\DocumentFactory;
 use Swis\JsonApi\Client\Item;
 use Swis\JsonApi\Client\ItemDocument;
 
-class DocumentFactoryTest extends AbstractTest
+class DocumentFactoryTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/ItemHydratorTest.php b/tests/ItemHydratorTest.php
index 8b23cfd..98ef91b 100644
--- a/tests/ItemHydratorTest.php
+++ b/tests/ItemHydratorTest.php
@@ -2,6 +2,7 @@
 
 namespace Swis\JsonApi\Client\Tests;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Collection;
 use Swis\JsonApi\Client\Exceptions\HydrationException;
 use Swis\JsonApi\Client\Item;
@@ -16,7 +17,7 @@ use Swis\JsonApi\Client\Tests\Mocks\Items\RelatedItem;
 use Swis\JsonApi\Client\Tests\Mocks\Items\WithRelationshipItem;
 use Swis\JsonApi\Client\TypeMapper;
 
-class ItemHydratorTest extends AbstractTest
+class ItemHydratorTest extends TestCase
 {
     /**
      * @return \Swis\JsonApi\Client\ItemHydrator
diff --git a/tests/ItemTest.php b/tests/ItemTest.php
index b06c239..5c26693 100644
--- a/tests/ItemTest.php
+++ b/tests/ItemTest.php
@@ -2,6 +2,7 @@
 
 namespace Swis\JsonApi\Client\Tests;
 
+use PHPUnit\Framework\TestCase;
 use stdClass;
 use Swis\JsonApi\Client\Collection;
 use Swis\JsonApi\Client\Exceptions\MassAssignmentException;
@@ -16,7 +17,7 @@ use Swis\JsonApi\Client\Tests\Mocks\Items\WithHiddenItem;
 use Swis\JsonApi\Client\Tests\Mocks\Items\WithRelationshipItem;
 use Swis\JsonApi\Client\Tests\Mocks\ItemStub;
 
-class ItemTest extends AbstractTest
+class ItemTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/CollectionParserTest.php b/tests/Parsers/CollectionParserTest.php
index e8273ae..83a0dc5 100644
--- a/tests/Parsers/CollectionParserTest.php
+++ b/tests/Parsers/CollectionParserTest.php
@@ -2,14 +2,14 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Collection;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
 use Swis\JsonApi\Client\Parsers\CollectionParser;
 use Swis\JsonApi\Client\Parsers\ItemParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 use Swis\JsonApi\Client\Tests\Mocks\Items\PlainItem;
 
-class CollectionParserTest extends AbstractTest
+class CollectionParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/DocumentParserTest.php b/tests/Parsers/DocumentParserTest.php
index f94b891..0a52b37 100644
--- a/tests/Parsers/DocumentParserTest.php
+++ b/tests/Parsers/DocumentParserTest.php
@@ -2,6 +2,7 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Collection;
 use Swis\JsonApi\Client\CollectionDocument;
 use Swis\JsonApi\Client\Document;
@@ -15,12 +16,11 @@ use Swis\JsonApi\Client\Link;
 use Swis\JsonApi\Client\Links;
 use Swis\JsonApi\Client\Meta;
 use Swis\JsonApi\Client\Parsers\DocumentParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 use Swis\JsonApi\Client\Tests\Mocks\Items\ChildItem;
 use Swis\JsonApi\Client\Tests\Mocks\Items\MasterItem;
 use Swis\JsonApi\Client\TypeMapper;
 
-class DocumentParserTest extends AbstractTest
+class DocumentParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/ErrorCollectionParserTest.php b/tests/Parsers/ErrorCollectionParserTest.php
index e07db29..0e5cb22 100644
--- a/tests/Parsers/ErrorCollectionParserTest.php
+++ b/tests/Parsers/ErrorCollectionParserTest.php
@@ -2,14 +2,14 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Error;
 use Swis\JsonApi\Client\ErrorCollection;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
 use Swis\JsonApi\Client\Parsers\ErrorCollectionParser;
 use Swis\JsonApi\Client\Parsers\ErrorParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 
-class ErrorCollectionParserTest extends AbstractTest
+class ErrorCollectionParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/ErrorParserTest.php b/tests/Parsers/ErrorParserTest.php
index 0e71165..6114a8e 100644
--- a/tests/Parsers/ErrorParserTest.php
+++ b/tests/Parsers/ErrorParserTest.php
@@ -2,6 +2,7 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Error;
 use Swis\JsonApi\Client\ErrorSource;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
@@ -10,9 +11,8 @@ use Swis\JsonApi\Client\Meta;
 use Swis\JsonApi\Client\Parsers\ErrorParser;
 use Swis\JsonApi\Client\Parsers\LinksParser;
 use Swis\JsonApi\Client\Parsers\MetaParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 
-class ErrorParserTest extends AbstractTest
+class ErrorParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/ItemParserTest.php b/tests/Parsers/ItemParserTest.php
index f677b3e..f99d374 100644
--- a/tests/Parsers/ItemParserTest.php
+++ b/tests/Parsers/ItemParserTest.php
@@ -2,6 +2,7 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Collection;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
 use Swis\JsonApi\Client\Interfaces\ItemInterface;
@@ -16,14 +17,13 @@ use Swis\JsonApi\Client\Relations\HasManyRelation;
 use Swis\JsonApi\Client\Relations\HasOneRelation;
 use Swis\JsonApi\Client\Relations\MorphToManyRelation;
 use Swis\JsonApi\Client\Relations\MorphToRelation;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 use Swis\JsonApi\Client\Tests\Mocks\Items\ChildItem;
 use Swis\JsonApi\Client\Tests\Mocks\Items\MasterItem;
 use Swis\JsonApi\Client\Tests\Mocks\Items\PlainItem;
 use Swis\JsonApi\Client\Tests\Mocks\Items\WithoutRelationshipsItem;
 use Swis\JsonApi\Client\TypeMapper;
 
-class ItemParserTest extends AbstractTest
+class ItemParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/JsonapiParserTest.php b/tests/Parsers/JsonapiParserTest.php
index 30bf210..7e43c32 100644
--- a/tests/Parsers/JsonapiParserTest.php
+++ b/tests/Parsers/JsonapiParserTest.php
@@ -2,14 +2,14 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
 use Swis\JsonApi\Client\Jsonapi;
 use Swis\JsonApi\Client\Meta;
 use Swis\JsonApi\Client\Parsers\JsonapiParser;
 use Swis\JsonApi\Client\Parsers\MetaParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 
-class JsonapiParserTest extends AbstractTest
+class JsonapiParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/LinksParserTest.php b/tests/Parsers/LinksParserTest.php
index f05c336..8340c52 100644
--- a/tests/Parsers/LinksParserTest.php
+++ b/tests/Parsers/LinksParserTest.php
@@ -2,15 +2,15 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
 use Swis\JsonApi\Client\Link;
 use Swis\JsonApi\Client\Links;
 use Swis\JsonApi\Client\Meta;
 use Swis\JsonApi\Client\Parsers\LinksParser;
 use Swis\JsonApi\Client\Parsers\MetaParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 
-class LinksParserTest extends AbstractTest
+class LinksParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/MetaParserTest.php b/tests/Parsers/MetaParserTest.php
index b84a23f..db875f8 100644
--- a/tests/Parsers/MetaParserTest.php
+++ b/tests/Parsers/MetaParserTest.php
@@ -2,12 +2,12 @@
 
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Exceptions\ValidationException;
 use Swis\JsonApi\Client\Meta;
 use Swis\JsonApi\Client\Parsers\MetaParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 
-class MetaParserTest extends AbstractTest
+class MetaParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Parsers/ResponseParserTest.php b/tests/Parsers/ResponseParserTest.php
index 8f94588..874ecc5 100644
--- a/tests/Parsers/ResponseParserTest.php
+++ b/tests/Parsers/ResponseParserTest.php
@@ -3,14 +3,14 @@
 namespace Swis\JsonApi\Client\Tests\Parsers;
 
 use GuzzleHttp\Psr7\Response;
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\CollectionDocument;
 use Swis\JsonApi\Client\Document;
 use Swis\JsonApi\Client\InvalidResponseDocument;
 use Swis\JsonApi\Client\Parsers\DocumentParser;
 use Swis\JsonApi\Client\Parsers\ResponseParser;
-use Swis\JsonApi\Client\Tests\AbstractTest;
 
-class ResponseParserTest extends AbstractTest
+class ResponseParserTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/Providers/TypeMapperServiceProviderTest.php b/tests/Providers/TypeMapperServiceProviderTest.php
deleted file mode 100644
index 2bd9ccc..0000000
--- a/tests/Providers/TypeMapperServiceProviderTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Tests\Providers;
-
-use Swis\JsonApi\Client\Tests\AbstractTest;
-use Swis\JsonApi\Client\Tests\Mocks\Items\ChildItem;
-use Swis\JsonApi\Client\Tests\Mocks\Items\MasterItem;
-use Swis\JsonApi\Client\Tests\Mocks\MockTypeMapperServiceProvider;
-use Swis\JsonApi\Client\TypeMapper;
-
-class TypeMapperServiceProviderTest extends AbstractTest
-{
-    /**
-     * @test
-     */
-    public function itRegistersTypesWithTheTypemapper()
-    {
-        $provider = new MockTypeMapperServiceProvider($this->app);
-        $typeMapper = $this->createMock(TypeMapper::class);
-        $typeMapper->expects($this->exactly(2))
-            ->method('setMapping')
-            ->withConsecutive(
-                ['master', MasterItem::class],
-                ['child', ChildItem::class]
-            );
-
-        $provider->boot($typeMapper);
-    }
-}
diff --git a/tests/TypeMapperTest.php b/tests/TypeMapperTest.php
index 1c522b6..62065d6 100644
--- a/tests/TypeMapperTest.php
+++ b/tests/TypeMapperTest.php
@@ -2,12 +2,13 @@
 
 namespace Swis\JsonApi\Client\Tests;
 
+use PHPUnit\Framework\TestCase;
 use Swis\JsonApi\Client\Exceptions\TypeMappingException;
 use Swis\JsonApi\Client\Interfaces\ItemInterface;
 use Swis\JsonApi\Client\Item;
 use Swis\JsonApi\Client\TypeMapper;
 
-class TypeMapperTest extends AbstractTest
+class TypeMapperTest extends TestCase
 {
     /**
      * @test
diff --git a/tests/_mocks/MockTypeMapperServiceProvider.php b/tests/_mocks/MockTypeMapperServiceProvider.php
deleted file mode 100644
index 1ed98aa..0000000
--- a/tests/_mocks/MockTypeMapperServiceProvider.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Tests\Mocks;
-
-use Swis\JsonApi\Client\Providers\TypeMapperServiceProvider;
-use Swis\JsonApi\Client\Tests\Mocks\Items\ChildItem;
-use Swis\JsonApi\Client\Tests\Mocks\Items\MasterItem;
-
-class MockTypeMapperServiceProvider extends TypeMapperServiceProvider
-{
-    protected $items = [
-        MasterItem::class,
-        ChildItem::class,
-    ];
-}
diff --git a/tests/_mocks/ResourceRegistrar/MockItem.php b/tests/_mocks/ResourceRegistrar/MockItem.php
deleted file mode 100644
index 98d125b..0000000
--- a/tests/_mocks/ResourceRegistrar/MockItem.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-namespace Swis\JsonApi\Client\Tests\Mocks\ResourceRegistrar;
-
-use Swis\JsonApi\Client\Item;
-
-class MockItem extends Item
-{
-    /**
-     * @var string
-     */
-    protected $type = 'test-resource-item';
-
-    /**
-     * @var array
-     */
-    protected $visible = [
-        'active',
-        'description',
-    ];
-
-    /**
-     * @var array
-     */
-    protected $casts = [
-        'active' => 'bool',
-    ];
-
-    /**
-     * @var array
-     */
-    protected $attributes = [
-        'active' => true,
-    ];
-}