File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Feature ;
4+
5+ use Illuminate \Support \Facades \Artisan ;
6+ use Illuminate \Support \Facades \DB ;
7+ use Tests \TestCase ;
8+
9+ final class ExcludedOriginsTest extends TestCase
10+ {
11+ public function setUp (): void
12+ {
13+ parent ::setUp ();
14+ $ this ->app = $ this ->createApplication ();
15+ }
16+
17+ public function testExcludedOriginsWithParams ()
18+ {
19+ putenv ('EXCLUDED_ORIGINS=origin1,origin2 ' );
20+ Artisan::call ('generate ' );
21+ $ this ->assertDatabaseHas (
22+ 'execution_logs ' ,
23+ [
24+ 'id ' => 1 ,
25+ 'translated ' => 13 ,
26+ 'failed ' => 1 ,
27+ 'last_id ' => 17 ,
28+ ],
29+ 'log '
30+ );
31+ }
32+
33+ public function testExcludedOriginsWithoutParams ()
34+ {
35+ putenv ('EXCLUDED_ORIGINS= ' );
36+ Artisan::call ('generate ' );
37+ $ this ->assertDatabaseHas (
38+ 'execution_logs ' ,
39+ [
40+ 'id ' => 1 ,
41+ 'translated ' => 15 ,
42+ 'failed ' => 1 ,
43+ 'last_id ' => 17 ,
44+ ],
45+ 'log '
46+ );
47+ }
48+
49+ public function tearDown (): void
50+ {
51+ parent ::tearDown ();
52+ $ this ->createApplication ();
53+ DB ::connection ('log ' )->table ('failed_logs ' )->truncate ();
54+ DB ::connection ('log ' )->table ('execution_logs ' )->truncate ();
55+ }
56+ }
You can’t perform that action at this time.
0 commit comments