浏览代码

Update test

Peter Ragheb 2 年之前
父节点
当前提交
d4a91b6547
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      tests/GenerateDocumentation/BehavioursTest.php

+ 6 - 5
tests/GenerateDocumentation/BehavioursTest.php

@@ -3,6 +3,7 @@
 namespace Knuckles\Scribe\Tests\GenerateDocumentation;
 
 use Illuminate\Support\Facades\Route as RouteFacade;
+use Knuckles\Scribe\Commands\GenerateDocumentation;
 use Knuckles\Scribe\Scribe;
 use Knuckles\Scribe\Tests\BaseLaravelTest;
 use Knuckles\Scribe\Tests\Fixtures\TestController;
@@ -128,19 +129,19 @@ class BehavioursTest extends BaseLaravelTest
     /** @test */
     public function calls_beforeGenerating_hook()
     {
-        $called = false;
+        $commandInstance = null;
 
-        Scribe::beforeGenerating(function () use (&$called){
-            $called = true;
+        Scribe::beforeGenerateCommandStarts(function (GenerateDocumentation $command) use (&$commandInstance){
+            $commandInstance = $command;
         });
 
         RouteFacade::get('/api/test', [TestController::class, 'withEndpointDescription']);
 
         $this->generate();
 
-        $this->assertTrue($called);
+        $this->assertTrue($commandInstance instanceof GenerateDocumentation);
 
-        Scribe::beforeGenerating(fn() => null);
+        Scribe::beforeGenerateCommandStarts(fn() => null);
     }
 
     /** @test */