From 4b11241741d7a2923b779220ed2d4bf6dc11734f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 15 Feb 2017 14:13:53 +0200 Subject: [PATCH] ITT: Formatted. --- README.md | 22 +++++++++++----------- src/Helpers/ApplicationHelpers.php | 10 +++++----- tests/Helpers/ApplicationHelpersTest.php | 14 +++++++------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b3783d7..551e23a 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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: @@ -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()` diff --git a/src/Helpers/ApplicationHelpers.php b/src/Helpers/ApplicationHelpers.php index c008e19..5e5c52a 100644 --- a/src/Helpers/ApplicationHelpers.php +++ b/src/Helpers/ApplicationHelpers.php @@ -4,11 +4,6 @@ trait ApplicationHelpers { - protected function isTravis() - { - return (bool) getenv('TRAVIS'); - } - protected function emulateLocal() { $this->emulateEnvironment('local'); @@ -25,4 +20,9 @@ protected function emulateEnvironment($environment) return $environment; }); } + + protected function isTravis() + { + return (bool) getenv('TRAVIS'); + } } diff --git a/tests/Helpers/ApplicationHelpersTest.php b/tests/Helpers/ApplicationHelpersTest.php index fb75e7c..e460176 100644 --- a/tests/Helpers/ApplicationHelpersTest.php +++ b/tests/Helpers/ApplicationHelpersTest.php @@ -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() { @@ -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()); + } }