查询一个字段的值.value

Testing Is Documentation

tests/Database/Read/ValueTest.php查询一个字段的值.value - 图1

Uses

  1. <?php
  2. use Tests\Database\DatabaseTestCase as TestCase;

value 查询基础用法

  1. public function testBaseUse(): void
  2. {
  3. $connect = $this->createDatabaseConnectMock();
  4. $sql = <<<'eot'
  5. [
  6. "SELECT `test`.`id` FROM `test` LIMIT 1",
  7. [],
  8. false
  9. ]
  10. eot;
  11. $this->assertSame(
  12. $sql,
  13. $this->varJson(
  14. $connect
  15. ->sql()
  16. ->table('test')
  17. ->value('id')
  18. )
  19. );
  20. }