|
11 | 11 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\UncachedPublisher; |
12 | 12 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\UncachedStore; |
13 | 13 | use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Http\Resources\Author as AuthorResource; |
14 | | -use GeneaLabs\LaravelModelCaching\Tests\TestCase; |
| 14 | +use GeneaLabs\LaravelModelCaching\Tests\UnitTestCase; |
15 | 15 | use Illuminate\Foundation\Testing\RefreshDatabase; |
16 | 16 |
|
17 | 17 | /** |
18 | 18 | * @SuppressWarnings(PHPMD.TooManyPublicMethods) |
19 | 19 | * @SuppressWarnings(PHPMD.TooManyMethods) |
20 | 20 | */ |
21 | | -class CachedBuilderTest extends TestCase |
| 21 | +class CachedBuilderTest extends UnitTestCase |
22 | 22 | { |
23 | 23 | use RefreshDatabase; |
24 | 24 |
|
@@ -412,24 +412,22 @@ public function testSumModelResultsCreatesCache() |
412 | 412 |
|
413 | 413 | public function testValueModelResultsCreatesCache() |
414 | 414 | { |
415 | | - $authors = (new Author)->with('books', 'profile') |
| 415 | + $authorName = (new Author)->with('books', 'profile') |
416 | 416 | ->value('name'); |
417 | | - $key = 'genealabslaravelmodelcachingtestsfixturesauthor_name-books-profile-first'; |
| 417 | + $key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-value_name'; |
418 | 418 | $tags = [ |
419 | 419 | 'genealabslaravelmodelcachingtestsfixturesauthor', |
420 | 420 | 'genealabslaravelmodelcachingtestsfixturesbook', |
421 | 421 | 'genealabslaravelmodelcachingtestsfixturesprofile', |
422 | 422 | ]; |
423 | 423 |
|
424 | | - $cachedResults = cache()->tags($tags) |
425 | | - ->get($key) |
426 | | - ->name; |
427 | | - |
428 | | - $liveResults = (new UncachedAuthor)->with('books', 'profile') |
| 424 | + $cachedResult = cache()->tags($tags) |
| 425 | + ->get($key); |
| 426 | + $liveResult = (new UncachedAuthor)->with('books', 'profile') |
429 | 427 | ->value('name'); |
430 | 428 |
|
431 | | - $this->assertEquals($authors, $cachedResults); |
432 | | - $this->assertEquals($liveResults, $cachedResults); |
| 429 | + $this->assertEquals($authorName, $cachedResult); |
| 430 | + $this->assertEquals($authorName, $liveResult); |
433 | 431 | } |
434 | 432 |
|
435 | 433 | public function testNestedRelationshipEagerLoading() |
|
0 commit comments