Skip to content

Commit bb2c39d

Browse files
committed
Add browser-kit-testing
1 parent b116416 commit bb2c39d

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"mockery/mockery": "0.9.*",
2424
"orchestra/database": "3.6.x-dev@dev",
2525
"orchestra/testbench": "^3.6",
26+
"orchestra/testbench-browser-kit": "^3.6",
2627
"php-coveralls/php-coveralls" : "*",
2728
"phpmd/phpmd": "*",
2829
"phpunit/phpunit": "*",

phpunit.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
syntaxCheck="false"
1414
>
1515
<testsuites>
16+
<testsuite name="Feature">
17+
<directory suffix="Test.php">./tests/Feature</directory>
18+
</testsuite>
1619
<testsuite name="Integration">
1720
<directory suffix="Test.php">./tests/Integration</directory>
1821
</testsuite>

tests/CreatesApplication.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,26 @@ trait CreatesApplication
1212
{
1313
protected $cache;
1414

15+
protected function cache()
16+
{
17+
$cache = cache();
18+
19+
if (config('laravel-model-caching.store')) {
20+
$cache = $cache->store(config('laravel-model-caching.store'));
21+
}
22+
23+
return $cache;
24+
}
25+
1526
public function setUp()
1627
{
1728
parent::setUp();
1829

30+
require(__DIR__ . '/routes/web.php');
31+
1932
$this->withFactories(__DIR__ . '/database/factories');
2033
$this->loadMigrationsFrom(__DIR__ . '/database/migrations');
34+
view()->addLocation(__DIR__ . '/resources/views', 'laravel-model-caching');
2135

2236
$this->cache = cache()
2337
->store(config('laravel-model-caching.store'));

tests/FeatureTestCase.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php namespace GeneaLabs\LaravelModelCaching\Tests;
2+
3+
use Orchestra\Testbench\BrowserKit\TestCase as BaseTestCase;
4+
5+
abstract class FeatureTestCase extends BaseTestCase
6+
{
7+
use CreatesApplication;
8+
}

tests/IntegrationTestCase.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,4 @@
55
abstract class IntegrationTestCase extends BaseTestCase
66
{
77
use CreatesApplication;
8-
9-
protected function cache()
10-
{
11-
$cache = cache();
12-
13-
if (config('laravel-model-caching.store')) {
14-
$cache = $cache->store(config('laravel-model-caching.store'));
15-
}
16-
17-
return $cache;
18-
}
198
}

0 commit comments

Comments
 (0)