Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 30, 2020
1 parent 10afe1e commit 3c59a5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Concerns/MakesAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait MakesAssertions
*
* @var bool
*/
public $makesSourceAssertion = false;
public $madeSourceAssertion = false;

/**
* Assert that the page title is the given value.
Expand Down Expand Up @@ -212,7 +212,7 @@ public function assertDontSeeIn($selector, $text)
*/
public function assertSourceHas($code)
{
$this->makesSourceAssertion = true;
$this->madeSourceAssertion = true;

PHPUnit::assertTrue(
Str::contains($this->driver->getPageSource(), $code),
Expand All @@ -230,7 +230,7 @@ public function assertSourceHas($code)
*/
public function assertSourceMissing($code)
{
$this->makesSourceAssertion = true;
$this->madeSourceAssertion = true;

PHPUnit::assertFalse(
Str::contains($this->driver->getPageSource(), $code),
Expand Down
9 changes: 4 additions & 5 deletions src/Concerns/ProvidesBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,17 @@ protected function storeConsoleLogsFor($browsers)
}

/**
* Store the source code for the given browsers.
* Store the source code for the given browsers (if necessary).
*
* @param \Illuminate\Support\Collection $browsers
* @return void
*/
protected function storeSourceLogsFor($browsers)
{
$browsers->each(function ($browser, $key) {
if (property_exists($browser, 'makesSourceAssertion') && $browser->makesSourceAssertion) {
$name = $this->getCallerName();

$browser->storeSource($name.'-'.$key);
if (property_exists($browser, 'makesSourceAssertion') &&
$browser->makesSourceAssertion) {
$browser->storeSource($this->getCallerName().'-'.$key);
}
});
}
Expand Down

0 comments on commit 3c59a5c

Please sign in to comment.