Skip to content

Commit

Permalink
ITT: Formatted.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Feb 15, 2017
1 parent beecbb5 commit 4b11241
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ Provides Laravel-specific testing helpers and asserts.
> New helpers are always adding. Feel free to contribute.
- [ApplicationHelpers](#applicationhelpers)
- [isTravis](#istravis)
- [emulateLocal](#emulatelocal)
- [emulateProduction](#emulateproduction)
- [emulateEnvironment](#emulateenvironment)
- [isTravis](#istravis)
- [ArtisanHelpers](#artisanhelpers)
- [runArtisan](#runartisan)
Expand Down Expand Up @@ -130,16 +130,6 @@ Provides Laravel-specific testing helpers and asserts.
### ApplicationHelpers
#### `isTravis()`
Checks if tests are running on [Travis CI](https://travis-ci.org) or not:
```php
if ($this->isTravis()) {
// Yep, it's Travis.
}
```

#### `emulateLocal()`
Emulates that application is working at `local` environment:
Expand All @@ -164,6 +154,16 @@ Emulates that application is working at specified environment:
$this->emulateEnvironment('demo');
```
#### `isTravis()`
Checks if tests are running on [Travis CI](https://travis-ci.org) or not:
```php
if ($this->isTravis()) {
// Yep, it's Travis.
}
```

### ArtisanHelpers

#### `runArtisan()`
Expand Down
10 changes: 5 additions & 5 deletions src/Helpers/ApplicationHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

trait ApplicationHelpers
{
protected function isTravis()
{
return (bool) getenv('TRAVIS');
}

protected function emulateLocal()
{
$this->emulateEnvironment('local');
Expand All @@ -25,4 +20,9 @@ protected function emulateEnvironment($environment)
return $environment;
});
}

protected function isTravis()
{
return (bool) getenv('TRAVIS');
}
}
14 changes: 7 additions & 7 deletions tests/Helpers/ApplicationHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

class ApplicationHelpersTest extends TestCase
{
/** @test */
public function it_can_check_if_tests_are_running_on_travis()
{
$expected = (bool) getenv('TRAVIS');
$this->assertEquals($expected, $this->isTravis());
}

/** @test */
public function it_can_emulate_local_environment()
{
Expand All @@ -32,4 +25,11 @@ public function it_can_emulate_any_environment()

$this->assertEquals('demo', $this->app->environment());
}

/** @test */
public function it_can_check_if_tests_are_running_on_travis()
{
$expected = (bool) getenv('TRAVIS');
$this->assertEquals($expected, $this->isTravis());
}
}

0 comments on commit 4b11241

Please sign in to comment.