瀏覽代碼

tests fix

Zolotov Alexander 6 年之前
父節點
當前提交
62185f6295
共有 2 個文件被更改,包括 7 次插入8 次删除
  1. 6 6
      tests/GenerateDocumentationTest.php
  2. 1 2
      tests/Unit/GeneratorTestCase.php

+ 6 - 6
tests/GenerateDocumentationTest.php

@@ -96,13 +96,13 @@ class GenerateDocumentationTest extends TestCase
     /** @test */
     public function console_command_work_with_rotes_uses_array()
     {
-        RouteFacade::get('/api/test', [TestController::class, 'withEndpointDescription']);
+        RouteFacade::get('/api/array/laravel/test', [TestController::class, 'withEndpointDescription']);
 
         config(['apidoc.routes.0.match.prefixes' => ['api/*']]);
         $output = $this->artisan('apidoc:generate');
 
-        $this->assertNotContains('Skipping route: [GET] test', $output);
-        $this->assertContains('Processed route: [GET] test', $output);
+        $this->assertNotContains('Skipping route: [GET] array/laravel/test', $output);
+        $this->assertContains('Processed route: [GET] array/laravel/test', $output);
     }
 
     /** @test */
@@ -110,7 +110,7 @@ class GenerateDocumentationTest extends TestCase
     {
         $api = app(\Dingo\Api\Routing\Router::class);
         $api->version('v1', function ($api) {
-            $api->get('/test', [TestController::class, 'withEndpointDescription']);
+            $api->get('/array/dingo/test', [TestController::class, 'withEndpointDescription']);
         });
 
         config(['apidoc.router' => 'dingo']);
@@ -118,8 +118,8 @@ class GenerateDocumentationTest extends TestCase
         config(['apidoc.routes.0.match.versions' => ['v1']]);
         $output = $this->artisan('apidoc:generate');
 
-        $this->assertNotContains('Skipping route: [GET] test', $output);
-        $this->assertContains('Processed route: [GET] test', $output);
+        $this->assertNotContains('Skipping route: [GET] array/dingo/test', $output);
+        $this->assertContains('Processed route: [GET] array/dingo/test', $output);
     }
 
     /** @test */

+ 1 - 2
tests/Unit/GeneratorTestCase.php

@@ -603,10 +603,9 @@ abstract class GeneratorTestCase extends TestCase
     /** @test */
     public function can_use_arrays_in_routes_uses()
     {
-        $route = $this->createRouteUsesArray('GET', '/api/test', 'withEndpointDescription');
+        $route = $this->createRouteUsesArray('GET', '/api/array/test', 'withEndpointDescription');
         $parsed = $this->generator->processRoute($route);
 
-        $this->assertSame('Group A', $parsed['group']);
         $this->assertSame('Example title.', $parsed['title']);
         $this->assertSame("This will be the long description.\nIt can also be multiple lines long.", $parsed['description']);
     }