Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangjchandler authored and actions-user committed Jun 30, 2021
1 parent 51bc501 commit 06d4671
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
namespace RyanChandler\BladeCacheDirective\Tests;

use Artisan;
use Illuminate\Support\Facades\Cache;

class CacheTest extends TestCase
{

protected $first_value;
protected $second_value;
protected $third_value;
Expand All @@ -24,21 +22,21 @@ public function setUp(): void
/** @test */
public function the_cache_directive_will_render_the_same_view_before_ttl_expired()
{
$time = $this->first_value;
$time = $this->first_value;
$this->assertEquals($this->first_value->format('Y-m-d H:i:s'), $this->renderView('cache', compact('time')));

$time = $this->second_value;
$time = $this->second_value;
$this->assertEquals($this->first_value->format('Y-m-d H:i:s'), $this->renderView('cache', compact('time')));
}

/** @test */
public function the_cache_directive_will_render_other_view_after_ttl_expired()
{
$time = $this->first_value;
$time = $this->first_value;
$this->assertEquals($this->first_value->format('Y-m-d H:i:s'), $this->renderView('cache', compact('time')));

sleep(2);
$time = $this->second_value;
$time = $this->second_value;
$this->assertNotEquals($this->first_value, $this->second_value);
$this->assertEquals($this->second_value->format('Y-m-d H:i:s'), $this->renderView('cache', compact('time')));
}
Expand All @@ -47,7 +45,7 @@ protected function renderView($view, $parameters)
{
Artisan::call('view:clear');

if(is_string($view)) {
if (is_string($view)) {
$view = view($view)->with($parameters);
}

Expand Down

0 comments on commit 06d4671

Please sign in to comment.