Skip to content

Instantly share code, notes, and snippets.

@thmsbkkr
Created February 26, 2016 00:48
Show Gist options
  • Save thmsbkkr/82f0109e0fd5dfd82a38 to your computer and use it in GitHub Desktop.
Save thmsbkkr/82f0109e0fd5dfd82a38 to your computer and use it in GitHub Desktop.
<?php
namespace App;
class BladeDirective
{
protected $cache;
public function __construct(RussianCache $cache)
{
$this->cache = $cache;
}
public function setUp($cacheKey)
{
}
}
/* Russian Cache */
<?php
use App\RussianCache;
use App\BladeDirective;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExampleTwoTest extends PHPUnit_Framework_TestCase
{
public function testItDoesSomething()
{
$cache = $this->prophesize('App\RussianCache');
$directive = new BladeDirective($cache->reveal());
$cache->has('cache-key')->shouldBeCalled();
$directive->setUp('cache-key');
}
}
<?php
namespace App;
class RussianCache
{
public function has()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment