Skip to content

Commit

Permalink
IHF: isTravis helper used.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Feb 15, 2017
1 parent 8d1a090 commit 3f5c07b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
12 changes: 8 additions & 4 deletions tests/format/BacktraceAsStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ class BacktraceAsStringTest extends TestCase
/** @test */
public function it_returns_backtrace_as_string_without_args()
{
$travis = $this->isTravis() ? '.travis' : '';
$path = __DIR__ . "/BacktraceAsStringTest/backtrace{$travis}.txt";

$start = file_get_contents($path);
$start = file_get_contents($this->getPath());
$backtrace = $this->getBacktrace();

$this->assertStringStartsWith($start, $backtrace);
}

private function getPath()
{
$travis = $this->isTravis() ? '.travis' : '';

return __DIR__ . "/BacktraceAsStringTest/backtrace{$travis}.txt";
}

private function getBacktrace()
{
return $this->anotherExtraMethod();
Expand Down
6 changes: 3 additions & 3 deletions tests/format/BacktraceAsStringTest/backtrace.travis.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#0 backtrace_as_string() called at [/home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/BacktraceAsStringTest.php:24]
#1 BacktraceAsStringTest->anotherExtraMethod() called at [/home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/BacktraceAsStringTest.php:19]
#2 BacktraceAsStringTest->getBacktrace() called at [/home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/BacktraceAsStringTest.php:12]
#0 backtrace_as_string() called at [/home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/BacktraceAsStringTest.php:28]
#1 BacktraceAsStringTest->anotherExtraMethod() called at [/home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/BacktraceAsStringTest.php:23]
#2 BacktraceAsStringTest->getBacktrace() called at [/home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/BacktraceAsStringTest.php:9]
#3 BacktraceAsStringTest->it_returns_backtrace_as_string_without_args()
6 changes: 3 additions & 3 deletions tests/format/BacktraceAsStringTest/backtrace.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#0 backtrace_as_string() called at [/Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/BacktraceAsStringTest.php:24]
#1 BacktraceAsStringTest->anotherExtraMethod() called at [/Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/BacktraceAsStringTest.php:19]
#2 BacktraceAsStringTest->getBacktrace() called at [/Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/BacktraceAsStringTest.php:12]
#0 backtrace_as_string() called at [/Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/BacktraceAsStringTest.php:28]
#1 BacktraceAsStringTest->anotherExtraMethod() called at [/Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/BacktraceAsStringTest.php:23]
#2 BacktraceAsStringTest->getBacktrace() called at [/Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/BacktraceAsStringTest.php:9]
#3 BacktraceAsStringTest->it_returns_backtrace_as_string_without_args()
12 changes: 8 additions & 4 deletions tests/format/MinimizedBacktraceAsStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ class MinimizedBacktraceAsStringTest extends TestCase
/** @test */
public function it_returns_minimized_backtrace_as_string()
{
$travis = $this->isTravis() ? '.travis' : '';
$path = __DIR__ . "/MinimizedBacktraceAsStringTest/backtrace{$travis}.txt";

$start = file_get_contents($path);
$start = file_get_contents($this->getPath());
$backtrace = $this->getBacktrace();

$this->assertStringStartsWith($start, $backtrace);
}

private function getPath()
{
$travis = $this->isTravis() ? '.travis' : '';

return __DIR__ . "/MinimizedBacktraceAsStringTest/backtrace{$travis}.txt";
}

private function getBacktrace()
{
return $this->anotherExtraMethod();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#0 /home/travis/build/dmitry-ivanov/laravel-helper-functions/src/format.php:60
#1 /home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:24
#2 /home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:19
#3 /home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:12
#1 /home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:28
#2 /home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:23
#3 /home/travis/build/dmitry-ivanov/laravel-helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:9
6 changes: 3 additions & 3 deletions tests/format/MinimizedBacktraceAsStringTest/backtrace.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#0 /Applications/MAMP/htdocs/illuminated/helper-functions/src/format.php:60
#1 /Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:24
#2 /Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:19
#3 /Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:12
#1 /Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:28
#2 /Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:23
#3 /Applications/MAMP/htdocs/illuminated/helper-functions/tests/format/MinimizedBacktraceAsStringTest.php:9

0 comments on commit 3f5c07b

Please sign in to comment.