File tree Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ Provides Laravel-specific testing helpers and asserts.
5959> New helpers are always adding. Feel free to contribute.
6060
6161- [ApplicationHelpers](#applicationhelpers)
62- - [isTravis](#istravis)
6362 - [emulateLocal](#emulatelocal)
6463 - [emulateProduction](#emulateproduction)
6564 - [emulateEnvironment](#emulateenvironment)
65+ - [isTravis](#istravis)
6666- [ArtisanHelpers](#artisanhelpers)
6767 - [runArtisan](#runartisan)
6868
@@ -130,16 +130,6 @@ Provides Laravel-specific testing helpers and asserts.
130130
131131### ApplicationHelpers
132132
133- #### `isTravis()`
134-
135- Checks if tests are running on [Travis CI](https://travis-ci.org) or not:
136-
137- ```php
138- if ($this->isTravis()) {
139- // Yep, it' s Travis.
140- }
141- ```
142-
143133#### `emulateLocal()`
144134
145135Emulates that application is working at `local` environment:
@@ -164,6 +154,16 @@ Emulates that application is working at specified environment:
164154$this->emulateEnvironment(' demo' );
165155```
166156
157+ #### `isTravis()`
158+
159+ Checks if tests are running on [Travis CI](https://travis-ci.org) or not:
160+
161+ ```php
162+ if ($this->isTravis()) {
163+ // Yep, it' s Travis.
164+ }
165+ ```
166+
167167### ArtisanHelpers
168168
169169#### ` runArtisan() `
Original file line number Diff line number Diff line change 44
55trait ApplicationHelpers
66{
7- protected function isTravis ()
8- {
9- return (bool ) getenv ('TRAVIS ' );
10- }
11-
127 protected function emulateLocal ()
138 {
149 $ this ->emulateEnvironment ('local ' );
@@ -25,4 +20,9 @@ protected function emulateEnvironment($environment)
2520 return $ environment ;
2621 });
2722 }
23+
24+ protected function isTravis ()
25+ {
26+ return (bool ) getenv ('TRAVIS ' );
27+ }
2828}
Original file line number Diff line number Diff line change 22
33class ApplicationHelpersTest extends TestCase
44{
5- /** @test */
6- public function it_can_check_if_tests_are_running_on_travis ()
7- {
8- $ expected = (bool ) getenv ('TRAVIS ' );
9- $ this ->assertEquals ($ expected , $ this ->isTravis ());
10- }
11-
125 /** @test */
136 public function it_can_emulate_local_environment ()
147 {
@@ -32,4 +25,11 @@ public function it_can_emulate_any_environment()
3225
3326 $ this ->assertEquals ('demo ' , $ this ->app ->environment ());
3427 }
28+
29+ /** @test */
30+ public function it_can_check_if_tests_are_running_on_travis ()
31+ {
32+ $ expected = (bool ) getenv ('TRAVIS ' );
33+ $ this ->assertEquals ($ expected , $ this ->isTravis ());
34+ }
3535}
You can’t perform that action at this time.
0 commit comments