Skip to content

Commit

Permalink
Update unity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
papac committed Sep 22, 2023
1 parent 63a9e3d commit 43f27ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Database/Barry/Relations/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(
public function getResults(): ?Model
{
$key = $this->query->getTable() . ":belongsto:" . $this->related->getTable() . ":" . $this->foreign_key;
$cache = Cache::cache('file')->get($key);
$cache = Cache::store('file')->get($key);

if (!is_null($cache)) {
$related = new $this->related();
Expand All @@ -63,7 +63,7 @@ public function getResults(): ?Model
$result = $this->query->first();

if (!is_null($result)) {
Cache::cache('file')->add($key, $result->toArray(), 500);
Cache::store('file')->add($key, $result->toArray(), 500);
}

return $result;
Expand Down
6 changes: 4 additions & 2 deletions tests/Database/Relation/BelongsToRelationQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

namespace Bow\Tests\Database\Relation;

use Bow\Cache\Cache;
use Bow\Database\Database;
use Bow\Database\Migration\SQLGenerator;
use Bow\Tests\Config\TestingConfiguration;
use Bow\Tests\Database\Stubs\MigrationExtendedStub;
use Bow\Tests\Database\Stubs\PetMasterModelStub;
use Bow\Tests\Database\Stubs\PetModelStub;
use Bow\Tests\Database\Stubs\PetMasterModelStub;
use Bow\Tests\Database\Stubs\MigrationExtendedStub;

class BelongsToRelationQueryTest extends \PHPUnit\Framework\TestCase
{
public static function setUpBeforeClass(): void
{
$config = TestingConfiguration::getConfig();
Database::configure($config["database"]);
Cache::configure($config["cache"]);
}

public function connectionNames()
Expand Down

0 comments on commit 43f27ab

Please sign in to comment.