# 查询多条数据.findAll

Testing Is Documentation

tests/Database/Read/FindAllTest.php

Uses

<?php

use Tests\Database\DatabaseTestCase as TestCase;

# findAll 查询多条数据

public function testBaseUse(): void
{
    $connect = $this->createDatabaseConnectMock();
    $sql = <<<'eot'
        [
            "SELECT `test`.* FROM `test`",
            [],
            false
        ]
        eot;

    $this->assertSame(
        $sql,
        $this->varJson(
            $connect
                ->sql()
                ->table('test')
                ->findAll()
        )
    );
}

# all.find 查询多条数据

public function testAllFind(): void
{
    $connect = $this->createDatabaseConnectMock();
    $sql = <<<'eot'
        [
            "SELECT `test`.* FROM `test`",
            [],
            false
        ]
        eot;

    $this->assertSame(
        $sql,
        $this->varJson(
            $connect
                ->sql()
                ->table('test')
                ->all()
                ->find()
        )
    );
}