File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ Provides Laravel-specific testing helpers and asserts.
6161- [ApplicationHelpers](#applicationhelpers)
6262 - [emulateLocal](#emulatelocal)
6363 - [emulateProduction](#emulateproduction)
64+ - [emulateEnvironment](#emulateenvironment)
6465- [ArtisanHelpers](#artisanhelpers)
6566 - [runConsoleCommand](#runconsolecommand)
6667
@@ -130,6 +131,14 @@ Emulates that application is working at `production` environment:
130131$this->emulateProduction();
131132```
132133
134+ #### `emulateEnvironment()`
135+
136+ Emulates that application is working at specified environment:
137+
138+ ```php
139+ $this->emulateEnvironment(' space' );
140+ ```
141+
133142### ArtisanHelpers
134143
135144#### `runConsoleCommand()`
Original file line number Diff line number Diff line change @@ -6,13 +6,23 @@ class ApplicationHelpersTest extends TestCase
66 public function it_can_emulate_local_environment ()
77 {
88 $ this ->emulateLocal ();
9+
910 $ this ->assertEquals ('local ' , $ this ->app ->environment ());
1011 }
1112
1213 /** @test */
1314 public function it_can_emulate_production_environment ()
1415 {
1516 $ this ->emulateProduction ();
17+
1618 $ this ->assertEquals ('production ' , $ this ->app ->environment ());
1719 }
20+
21+ /** @test */
22+ public function it_can_emulate_any_environment ()
23+ {
24+ $ this ->emulateEnvironment ('space ' );
25+
26+ $ this ->assertEquals ('space ' , $ this ->app ->environment ());
27+ }
1828}
You can’t perform that action at this time.
0 commit comments