Browse Source

Fix tests

shalvah 4 years ago
parent
commit
b3e4bf3f13

+ 3 - 3
camel/Camel.php

@@ -25,7 +25,7 @@ class Camel
     public static function loadEndpointsIntoGroups(string $folder): array
     {
         $groups = [];
-        self::loadEndpointsFromCamelFiles($folder, function ($group) use ($groups) {
+        self::loadEndpointsFromCamelFiles($folder, function ($group) use (&$groups) {
             $group['endpoints'] = array_map(function (array $endpoint) {
                 return OutputEndpointData::fromExtractedEndpointArray($endpoint);
             }, $group['endpoints']);
@@ -44,7 +44,7 @@ class Camel
     public static function loadEndpointsToFlatPrimitivesArray(string $folder): array
     {
         $endpoints = [];
-        self::loadEndpointsFromCamelFiles($folder, function ($group) use ($endpoints) {
+        self::loadEndpointsFromCamelFiles($folder, function ($group) use (&$endpoints) {
             foreach ($group['endpoints'] as $endpoint) {
                 $endpoints[] = $endpoint;
             }
@@ -114,7 +114,7 @@ class Camel
                     return $endpointData->metadata->groupDescription !== '';
                 })->metadata->groupDescription ?? '',
             'endpoints' => $group->map(fn(ExtractedEndpointData $endpointData) => $endpointData->forSerialisation()->toArray())->all(),
-        ])->all();
+        ])->values()->all();
     }
 
     public static function prepareGroupedEndpointsForOutput(array $groupedEndpoints): array

+ 9 - 0
camel/Output/Parameter.php

@@ -11,4 +11,13 @@ class Parameter extends \Knuckles\Camel\Extraction\Parameter
     public $example = null;
     public string $type = 'string';
     public array $__fields = [];
+
+    public function toArray(): array
+    {
+        if (empty($this->exceptKeys)) {
+            return $this->except('__fields')->toArray();
+        }
+
+        return parent::toArray();
+    }
 }

+ 5 - 6
composer.dingo.json

@@ -21,12 +21,11 @@
         "ext-json": "*",
         "ext-pdo": "*",
         "dingo/api": "^2.3|^3.0",
-        "erusev/parsedown": "^1.7.4",
+        "erusev/parsedown": "^1.7",
         "fakerphp/faker": "^1.9.1",
         "illuminate/console": "^6.0|^7.0|^8.0",
         "illuminate/routing": "^6.0|^7.0|^8.0",
         "illuminate/support": "^6.0|^7.0|^8.0",
-        "knuckleswtf/pastel": "^1.3.6",
         "league/flysystem": "^1.0",
         "mpociot/reflection-docblock": "^1.0.1",
         "nunomaduro/collision": "^3.0|^4.0|^5.0",
@@ -60,10 +59,10 @@
     },
     "scripts": {
         "lint": "phpstan analyse -c ./phpstan.neon src",
-        "test": "phpunit --stop-on-failure --group dingo",
-        "test-ci": "phpunit --group dingo",
-        "test-parallel": "paratest -p4 --stop-on-failure --parallel-suite --group dingo tests",
-        "test-parallel-ci": "paratest -p4 --parallel-suite --group dingo tests"
+        "test": "phpunit --no-coverage --stop-on-failure --group dingo",
+        "test-ci": "phpunit --no-coverage --group dingo",
+        "test-parallel": "paratest -p16 --stop-on-failure --no-coverage --group dingo tests",
+        "test-parallel-ci": "paratest -p16 --no-coverage --group dingo tests"
     },
     "extra": {
         "laravel": {

+ 4 - 4
composer.json

@@ -61,10 +61,10 @@
   },
   "scripts": {
     "lint": "phpstan analyse -c ./phpstan.neon src",
-    "test": "phpunit --stop-on-failure --exclude-group dingo",
-    "test-ci": "phpunit --exclude-group dingo",
-    "test-parallel": "paratest -p4 --stop-on-failure --parallel-suite --exclude-group dingo tests",
-    "test-parallel-ci": "paratest -p4 --parallel-suite --exclude-group dingo tests"
+    "test": "phpunit --no-coverage --stop-on-failure --exclude-group dingo",
+    "test-ci": "phpunit --no-coverage --exclude-group dingo",
+    "test-parallel": "paratest -p16 --stop-on-failure --no-coverage --exclude-group dingo",
+    "test-parallel-ci": "paratest -p16 --no-coverage --exclude-group dingo"
   },
   "extra": {
     "laravel": {

+ 5 - 2
phpunit.xml

@@ -17,7 +17,7 @@
         </include>
         <exclude>
             <file>src/ScribeServiceProvider.php</file>
-            <file>resources/views/pastel.blade.php</file>
+            <directory>resources/views/</directory>
         </exclude>
     </coverage>
     <testsuites>
@@ -33,10 +33,13 @@
         </testsuite>
         <testsuite name="Unit Tests 1">
             <file>tests/Unit/ExtractorTest.php</file>
-            <file>tests/Unit/AnnotationParserTest.php</file>
             <file>tests/Unit/ExtractorPluginSystemTest.php</file>
         </testsuite>
         <testsuite name="Unit Tests 2">
+            <file>tests/Unit/AnnotationParserTest.php</file>
+            <file>tests/Unit/CamelTest.php</file>
+        </testsuite>
+        <testsuite name="Unit Tests 3">
             <file>tests/Unit/OpenAPISpecWriterTest.php</file>
             <file>tests/Unit/PostmanCollectionWriterTest.php</file>
         </testsuite>

+ 3 - 3
resources/example_custom_endpoint.yaml

@@ -17,7 +17,7 @@
 #    param:
 #      name: param
 #      description: A URL param for no reason.
-#      required: false
+#      required: true
 #      example: 2
 #      type: integer
 #  queryParameters:
@@ -38,11 +38,11 @@
 #      type: 'string[]'
 #  responses:
 #    - status: 200
-#      content:
+#      description: 'When the thing was done smoothly.'
+#      content: # Your response content can be an object, an array, a string or empty.
 #         {
 #           "hey": "ho ho ho"
 #         }
-#      description: 'When the thing was done smoothly.'
 #  responseFields:
 #    hey:
 #      name: hey

+ 4 - 4
src/Commands/GenerateDocumentation.php

@@ -28,8 +28,8 @@ use Symfony\Component\Yaml\Yaml;
 class GenerateDocumentation extends Command
 {
     protected $signature = "scribe:generate
-                            {--force : Discard any changes you've made to the Markdown files}
-                            {--no-extraction : Skip extraction of route info and just transform the Markdown files}
+                            {--force : Discard any changes you've made to the YAML or Markdown files}
+                            {--no-extraction : Skip extraction of route and API info and just transform the YAML and Markdown files into HTML}
     ";
 
     protected $description = 'Generate API documentation from your Laravel/Dingo routes.';
@@ -64,7 +64,7 @@ class GenerateDocumentation extends Command
             $this->extractAndWriteApiDetailsToDisk();
         } else {
             if (!is_dir(static::$camelDir)) {
-                throw new \Exception("Can't use --no-extraction because there are no endpoints in the {static::$camelDir} directory.");
+                throw new \InvalidArgumentException("Can't use --no-extraction because there are no endpoints in the {static::$camelDir} directory.");
             }
             $groupedEndpoints = Camel::loadEndpointsIntoGroups(static::$camelDir);
         }
@@ -147,7 +147,6 @@ class GenerateDocumentation extends Command
             'bodyParameters',
             'responses',
             'responseFields',
-            'auth',
         ];
 
         $changed = [];
@@ -305,6 +304,7 @@ class GenerateDocumentation extends Command
 
     protected function writeExampleCustomEndpoint(): void
     {
+        // We add an example to guide users in case they need to add a custom endpoint.
         if (!file_exists(static::$camelDir.'/custom.0.yaml')) {
             copy(__DIR__ . '/../../resources/example_custom_endpoint.yaml', static::$camelDir . '/custom.0.yaml');
         }

+ 37 - 0
tests/BaseLaravelTest.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace Knuckles\Scribe\Tests;
+
+use Knuckles\Scribe\ScribeServiceProvider;
+use Orchestra\Testbench\TestCase;
+
+class BaseLaravelTest extends TestCase
+{
+    use TestHelpers;
+
+    protected function getEnvironmentSetUp($app)
+    {
+        $app['config']->set('database.default', 'test');
+        $app['config']->set('database.connections.test', [
+            'driver' => 'sqlite',
+            'database' => ':memory:',
+            'prefix' => '',
+        ]);
+    }
+
+    /**
+     * @param \Illuminate\Foundation\Application $app
+     *
+     * @return array
+     */
+    protected function getPackageProviders($app)
+    {
+        $providers = [
+            ScribeServiceProvider::class,
+        ];
+        if (class_exists(\Dingo\Api\Provider\LaravelServiceProvider::class)) {
+            $providers[] = \Dingo\Api\Provider\LaravelServiceProvider::class;
+        }
+        return $providers;
+    }
+}

+ 45 - 37
tests/GenerateDocumentationTest.php

@@ -11,10 +11,9 @@ use Knuckles\Scribe\Tests\Fixtures\TestPartialResourceController;
 use Knuckles\Scribe\Tests\Fixtures\TestResourceController;
 use Knuckles\Scribe\Tests\Fixtures\TestUser;
 use Knuckles\Scribe\Tools\Utils;
-use Orchestra\Testbench\TestCase;
 use Symfony\Component\Yaml\Yaml;
 
-class GenerateDocumentationTest extends TestCase
+class GenerateDocumentationTest extends BaseLaravelTest
 {
     use TestHelpers;
 
@@ -38,9 +37,7 @@ class GenerateDocumentationTest extends TestCase
     public function tearDown(): void
     {
         Utils::deleteDirectoryAndContents('public/docs');
-        Utils::deleteDirectoryAndContents('resources/docs');
-        Utils::deleteDirectoryAndContents('static/docs');
-        Utils::deleteDirectoryAndContents('.endpoints');
+        Utils::deleteDirectoryAndContents('.scribe');
     }
 
     /**
@@ -305,8 +302,9 @@ class GenerateDocumentationTest extends TestCase
         ]);
         $this->artisan('scribe:generate');
 
-        $generatedMarkdown = $this->getFileContents(__DIR__ . '/../resources/docs/groups/group-a.md');
-        $this->assertContainsIgnoringWhitespace('"Authorization": "customAuthToken","Custom-Header":"NotSoCustom"', $generatedMarkdown);
+        $endpointDetails = Yaml::parseFile(__DIR__ . '/../.scribe/endpoints/0.yaml')['endpoints'][0];
+        $this->assertEquals("customAuthToken", $endpointDetails['headers']["Authorization"]);
+        $this->assertEquals("NotSoCustom", $endpointDetails['headers']["Custom-Header"]);
     }
 
     /** @test */
@@ -317,8 +315,8 @@ class GenerateDocumentationTest extends TestCase
         config(['scribe.routes.0.prefixes' => ['api/*']]);
         $this->artisan('scribe:generate');
 
-        $generatedMarkdown = file_get_contents(__DIR__ . '/../resources/docs/groups/group-a.md');
-        $this->assertStringContainsString('Лорем ипсум долор сит амет', $generatedMarkdown);
+        $generatedHtml = file_get_contents('public/docs/index.html');
+        $this->assertStringContainsString('Лорем ипсум долор сит амет', $generatedHtml);
     }
 
     /** @test */
@@ -332,9 +330,12 @@ class GenerateDocumentationTest extends TestCase
         config(['scribe.routes.0.prefixes' => ['api/*']]);
         $this->artisan('scribe:generate');
 
-        $this->assertFileExists(__DIR__ . '/../resources/docs/groups/1-group-1.md');
-        $this->assertFileExists(__DIR__ . '/../resources/docs/groups/2-group-2.md');
-        $this->assertFileExists(__DIR__ . '/../resources/docs/groups/10-group-10.md');
+        $this->assertFileExists(__DIR__ . '/../.scribe/endpoints/0.yaml');
+        $this->assertFileExists(__DIR__ . '/../.scribe/endpoints/1.yaml');
+        $this->assertFileExists(__DIR__ . '/../.scribe/endpoints/2.yaml');
+        $this->assertEquals('1. Group 1', Yaml::parseFile(__DIR__ . '/../.scribe/endpoints/0.yaml')['name']);
+        $this->assertEquals('2. Group 2', Yaml::parseFile(__DIR__ . '/../.scribe/endpoints/1.yaml')['name']);
+        $this->assertEquals('10. Group 10', Yaml::parseFile(__DIR__ . '/../.scribe/endpoints/2.yaml')['name']);
     }
 
     /** @test */
@@ -351,40 +352,47 @@ class GenerateDocumentationTest extends TestCase
     }
 
     /** @test */
-    public function will_not_overwrite_manually_modified_markdown_files_unless_force_flag_is_set()
+    public function will_not_overwrite_manually_modified_content_unless_force_flag_is_set()
     {
-        RouteFacade::get('/api/action1', TestGroupController::class . '@action1');
-        RouteFacade::get('/api/action1b', TestGroupController::class . '@action1b');
-        RouteFacade::get('/api/action2', TestGroupController::class . '@action2');
-
+        RouteFacade::get('/api/action1', [TestGroupController::class, 'action1']);
+        RouteFacade::get('/api/action1b', [TestGroupController::class, 'action1b']);
         config(['scribe.routes.0.prefixes' => ['api/*']]);
 
         $this->artisan('scribe:generate');
 
-        $group1FilePath = realpath(__DIR__ . '/../resources/docs/groups/1-group-1.md');
-        $group2FilePath = realpath(__DIR__ . '/../resources/docs/groups/2-group-2.md');
-        $authFilePath = realpath(__DIR__ . '/../resources/docs/authentication.md');
-
-        $file1MtimeAfterFirstGeneration = filemtime($group1FilePath);
-        $file2MtimeAfterFirstGeneration = filemtime($group2FilePath);
-        $authFileMtimeAfterFirstGeneration = filemtime($authFilePath);
-
+        $authFilePath = '.scribe/authentication.md';
+        $group1FilePath = '.scribe/endpoints/0.yaml';
+
+        $group = Yaml::parseFile($group1FilePath);
+        $this->assertEquals('api/action1', $group['endpoints'][0]['uri']);
+        $this->assertEquals([], $group['endpoints'][0]['urlParameters']);
+        $extraParam = [
+            'name' => 'a_param',
+            'description' => 'A URL param.',
+            'required' => true,
+            'example' => 6,
+            'type' => 'integer',
+        ];
+        $group['endpoints'][0]['urlParameters']['a_param'] = $extraParam;
+        file_put_contents($group1FilePath, Yaml::dump(
+            $group, 10, 2,
+            Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP
+        ));
         sleep(1);
-        touch($group1FilePath);
-        touch($authFilePath);
-        $file1MtimeAfterManualModification = filemtime($group1FilePath);
-        $authFileMtimeAfterManualModification = filemtime($authFilePath);
-        $this->assertGreaterThan($file1MtimeAfterFirstGeneration, $file1MtimeAfterManualModification);
-        $this->assertGreaterThan($authFileMtimeAfterFirstGeneration, $authFileMtimeAfterManualModification);
+        file_put_contents($authFilePath, 'Some other useful stuff.', FILE_APPEND);
 
         $this->artisan('scribe:generate');
 
-        $file1MtimeAfterSecondGeneration = filemtime($group1FilePath);
-        $file2MtimeAfterSecondGeneration = filemtime($group2FilePath);
-        $authFileMtimeAfterSecondGeneration = filemtime($authFilePath);
+        $group = Yaml::parseFile($group1FilePath);
+        $this->assertEquals('api/action1', $group['endpoints'][0]['uri']);
+        $this->assertEquals(['a_param' => $extraParam], $group['endpoints'][0]['urlParameters']);
+        $this->assertStringContainsString('Some other useful stuff.', file_get_contents($authFilePath));
+
+        $this->artisan('scribe:generate', ['--force' => true]);
 
-        $this->assertEquals($file1MtimeAfterManualModification, $file1MtimeAfterSecondGeneration);
-        $this->assertNotEquals($file2MtimeAfterFirstGeneration, $file2MtimeAfterSecondGeneration);
-        $this->assertNotEquals($authFileMtimeAfterFirstGeneration, $authFileMtimeAfterSecondGeneration);
+        $group = Yaml::parseFile($group1FilePath);
+        $this->assertEquals('api/action1', $group['endpoints'][0]['uri']);
+        $this->assertEquals([], $group['endpoints'][0]['urlParameters']);
+        $this->assertStringNotContainsString('Some other useful stuff.', file_get_contents($authFilePath));
     }
 }

+ 2 - 13
tests/Strategies/BodyParameters/GetFromFormRequestTest.php

@@ -6,26 +6,15 @@ use Illuminate\Support\Facades\Validator;
 use Illuminate\Validation\ValidationException;
 use Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest;
 use Knuckles\Scribe\ScribeServiceProvider;
+use Knuckles\Scribe\Tests\BaseLaravelTest;
 use Knuckles\Scribe\Tests\Fixtures\TestController;
 use Knuckles\Scribe\Tools\DocumentationConfig;
 use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
-use Orchestra\Testbench\TestCase;
 
-class GetFromFormRequestTest extends TestCase
+class GetFromFormRequestTest extends BaseLaravelTest
 {
     use ArraySubsetAsserts;
 
-    protected function getPackageProviders($app)
-    {
-        $providers = [
-            ScribeServiceProvider::class,
-        ];
-        if (class_exists(\Dingo\Api\Provider\LaravelServiceProvider::class)) {
-            $providers[] = \Dingo\Api\Provider\LaravelServiceProvider::class;
-        }
-        return $providers;
-    }
-
     /** @test */
     public function can_fetch_from_form_request()
     {

+ 2 - 13
tests/Strategies/Responses/ResponseCallsTest.php

@@ -10,27 +10,16 @@ use Knuckles\Camel\Extraction\ResponseCollection;
 use Knuckles\Scribe\Extracting\Extractor;
 use Knuckles\Scribe\Extracting\Strategies\Responses\ResponseCalls;
 use Knuckles\Scribe\ScribeServiceProvider;
+use Knuckles\Scribe\Tests\BaseLaravelTest;
 use Knuckles\Scribe\Tests\Fixtures\TestController;
 use Knuckles\Scribe\Tools\DocumentationConfig;
 use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
-use Orchestra\Testbench\TestCase;
 use Illuminate\Support\Facades\Route as LaravelRouteFacade;
 
-class ResponseCallsTest extends TestCase
+class ResponseCallsTest extends BaseLaravelTest
 {
     use ArraySubsetAsserts;
 
-    protected function getPackageProviders($app)
-    {
-        $providers = [
-            ScribeServiceProvider::class,
-        ];
-        if (class_exists(\Dingo\Api\Provider\LaravelServiceProvider::class)) {
-            $providers[] = \Dingo\Api\Provider\LaravelServiceProvider::class;
-        }
-        return $providers;
-    }
-
     protected function setUp(): void
     {
         parent::setUp();

+ 2 - 2
tests/Strategies/Responses/UseApiResourceTagsTest.php

@@ -6,15 +6,15 @@ use Illuminate\Routing\Route;
 use Knuckles\Camel\Extraction\ExtractedEndpointData;
 use Knuckles\Scribe\Extracting\Strategies\Responses\UseApiResourceTags;
 use Knuckles\Scribe\ScribeServiceProvider;
+use Knuckles\Scribe\Tests\BaseLaravelTest;
 use Knuckles\Scribe\Tests\Fixtures\TestController;
 use Knuckles\Scribe\Tests\Fixtures\TestUser;
 use Knuckles\Scribe\Tools\DocumentationConfig;
 use Knuckles\Scribe\Tools\Utils;
 use Mpociot\Reflection\DocBlock\Tag;
 use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
-use Orchestra\Testbench\TestCase;
 
-class UseApiResourceTagsTest extends TestCase
+class UseApiResourceTagsTest extends BaseLaravelTest
 {
     use ArraySubsetAsserts;
 

+ 2 - 13
tests/Strategies/Responses/UseTransformerTagsTest.php

@@ -4,27 +4,16 @@ namespace Knuckles\Scribe\Tests\Strategies\Responses;
 
 use Knuckles\Scribe\Extracting\Strategies\Responses\UseTransformerTags;
 use Knuckles\Scribe\ScribeServiceProvider;
+use Knuckles\Scribe\Tests\BaseLaravelTest;
 use Knuckles\Scribe\Tests\Fixtures\TestUser;
 use Knuckles\Scribe\Tools\DocumentationConfig;
 use Mpociot\Reflection\DocBlock\Tag;
 use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
-use Orchestra\Testbench\TestCase;
 
-class UseTransformerTagsTest extends TestCase
+class UseTransformerTagsTest extends BaseLaravelTest
 {
     use ArraySubsetAsserts;
 
-    protected function getPackageProviders($app)
-    {
-        $providers = [
-            ScribeServiceProvider::class,
-        ];
-        if (class_exists(\Dingo\Api\Provider\LaravelServiceProvider::class)) {
-            $providers[] = \Dingo\Api\Provider\LaravelServiceProvider::class;
-        }
-        return $providers;
-    }
-
     protected function setUp(): void
     {
         parent::setUp();

+ 0 - 32
tests/TestHelpers.php

@@ -20,36 +20,4 @@ trait TestHelpers
 
         return $kernel->output();
     }
-
-    private function assertFilesHaveSameContent($pathToExpected, $pathToActual)
-    {
-        $actual = $this->getFileContents($pathToActual);
-        $expected = $this->getFileContents($pathToExpected);
-        $this->assertSame($expected, $actual);
-    }
-
-    /**
-     * Get the contents of a file in a cross-platform-compatible way.
-     *
-     * @param $path
-     *
-     * @return string
-     */
-    private function getFileContents($path)
-    {
-        return str_replace("\r\n", "\n", file_get_contents($path));
-    }
-
-    /**
-     * Assert that a string contains another string, ignoring all whitespace.
-     *
-     * @param $needle
-     * @param $haystack
-     */
-    private function assertContainsIgnoringWhitespace($needle, $haystack)
-    {
-        $haystack = preg_replace('/\s/', '', $haystack);
-        $needle = preg_replace('/\s/', '', $needle);
-        $this->assertStringContainsString($needle, $haystack);
-    }
 }

+ 11 - 0
tests/Unit/CamelTest.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace Knuckles\Scribe\Tests\Unit;
+
+use Knuckles\Camel\Camel;
+use PHPUnit\Framework\TestCase;
+
+class CamelTest extends TestCase
+{
+
+}

+ 2 - 2
tests/Unit/OpenAPISpecWriterTest.php

@@ -536,7 +536,7 @@ class OpenAPISpecWriterTest extends TestCase
             data_set($data, $key, $value);
         }
 
-        return new OutputEndpointData($data);
+        return OutputEndpointData::create($data);
     }
 
     protected function createGroup(array $endpoints)
@@ -545,7 +545,7 @@ class OpenAPISpecWriterTest extends TestCase
         return [
             'description' => '',
             'name' => $faker->randomElement(['Endpoints', 'Group A', 'Group B']),
-            'endpoints' => array_map(fn ($e) => $e->toArray(), $endpoints),
+            'endpoints' => $endpoints,
         ];
     }
 }

+ 2 - 3
tests/Unit/PostmanCollectionWriterTest.php

@@ -270,7 +270,7 @@ class PostmanCollectionWriterTest extends TestCase
 
     protected function createMockEndpointData(string $path, string $title = ''): OutputEndpointData
     {
-        return new OutputEndpointData([
+        return OutputEndpointData::create([
             'uri' => $path,
             'methods' => ['GET'],
             'metadata' => [
@@ -292,11 +292,10 @@ class PostmanCollectionWriterTest extends TestCase
 
     protected function createMockEndpointGroup(array $endpoints, string $groupName = 'Group')
     {
-        $faker = Factory::create();
         return [
             'description' => '',
             'name' => $groupName,
-            'endpoints' => array_map(fn($e) => $e->toArray(), $endpoints),
+            'endpoints' => $endpoints,
         ];
     }
 }

+ 2 - 2
tests/Unit/RouteMatcherDingoTest.php

@@ -5,12 +5,12 @@ namespace Knuckles\Scribe\Tests\Unit;
 use Dingo\Api\Routing\Router;
 use Illuminate\Support\Str;
 use Knuckles\Scribe\Matching\RouteMatcher;
-use Orchestra\Testbench\TestCase;
+use Knuckles\Scribe\Tests\BaseLaravelTest;
 
 /**
  * @group dingo
  */
-class RouteMatcherDingoTest extends TestCase
+class RouteMatcherDingoTest extends BaseLaravelTest
 {
     protected function getPackageProviders($app)
     {

+ 2 - 2
tests/Unit/RouteMatcherTest.php

@@ -5,9 +5,9 @@ namespace Knuckles\Scribe\Tests\Unit;
 use Illuminate\Support\Facades\Route as RouteFacade;
 use Illuminate\Support\Str;
 use Knuckles\Scribe\Matching\RouteMatcher;
-use Orchestra\Testbench\TestCase;
+use Knuckles\Scribe\Tests\BaseLaravelTest;
 
-class RouteMatcherTest extends TestCase
+class RouteMatcherTest extends BaseLaravelTest
 {
     public function testRespectsDomainsRuleForLaravelRouter()
     {