查询多条数据.findAll ¶
Testing Is Documentation
Uses
php
<?php
use Tests\Database\DatabaseTestCase as TestCase;
findAll 查询多条数据 ¶
php
public function testBaseUse(): void
{
$connect = $this->createDatabaseConnectMock();
$sql = <<<'eot'
[
"SELECT `test`.* FROM `test`",
[],
false
]
eot;
static::assertSame(
$sql,
$this->varJsonSql(
$connect
->table('test')
->findAll(),
$connect
)
);
}
all.find 查询多条数据 ¶
php
public function testAllFind(): void
{
$connect = $this->createDatabaseConnectMock();
$sql = <<<'eot'
[
"SELECT `test`.* FROM `test`",
[],
false
]
eot;
static::assertSame(
$sql,
$this->varJsonSql(
$connect
->table('test')
->all()
->find(),
$connect
)
);
}