-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActiveQueryTest.php
More file actions
47 lines (38 loc) · 1015 Bytes
/
ActiveQueryTest.php
File metadata and controls
47 lines (38 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
declare(strict_types=1);
namespace Cycle\Tests\Query;
use Cycle\ActiveRecord\Facade;
use Cycle\App\Entity\User;
use Cycle\Database\Database;
use Cycle\Database\DatabaseManager
use Cycle\Tests\DatabaseTestCase;
use PHPUnit\Framework\Attributes\Test;
use ReflectionException;
use Throwable;
final class ActiveQueryTest extends DatabaseTestCase
{
/**
* @throws Throwable
*/
public function tearDown(): void
{
parent::tearDown();
$databaseManager = $this->getContainer()->get(DatabaseManager::class);
/** @var Database $database */
$database = $databaseManager->database('default');
$this->dropDatabase($database);
Facade::reset();
}
/**
* @test
*
* @throws ReflectionException
*/
#[Test]
public function it_checks_if_fetch_all_method_returns_array_by_default(): void
{
$users = User::queryWithCollection()->fetchAll();
dd($users);
$this::assertIsArray($users);
}
}