Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 46 lines 1.1 kB view raw
1<?php 2 3namespace SocialDept\AtpSchema\Tests\Unit\Console; 4 5use Orchestra\Testbench\TestCase; 6use SocialDept\AtpSchema\Console\ListCommand; 7use SocialDept\AtpSchema\SchemaServiceProvider; 8 9class ListCommandTest extends TestCase 10{ 11 protected function getPackageProviders($app): array 12 { 13 return [SchemaServiceProvider::class]; 14 } 15 16 protected function setUp(): void 17 { 18 parent::setUp(); 19 20 config([ 21 'schema.sources' => [__DIR__.'/../../fixtures'], 22 ]); 23 } 24 25 public function test_it_lists_schemas(): void 26 { 27 $this->artisan(ListCommand::class) 28 ->assertSuccessful(); 29 } 30 31 public function test_it_filters_schemas_by_pattern(): void 32 { 33 $this->artisan(ListCommand::class, [ 34 '--filter' => 'app.bsky.*', 35 ]) 36 ->assertSuccessful(); 37 } 38 39 public function test_it_filters_schemas_by_type(): void 40 { 41 $this->artisan(ListCommand::class, [ 42 '--type' => 'record', 43 ]) 44 ->assertSuccessful(); 45 } 46}