123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace EasySwoole\ORM\Tests;
- use EasySwoole\Mysqli\Client;
- use EasySwoole\Mysqli\QueryBuilder;
- use EasySwoole\ORM\Db\Config;
- use EasySwoole\ORM\Db\Connection;
- use EasySwoole\ORM\Db\MysqlPool;
- use EasySwoole\ORM\Db\Result;
- use PHPUnit\Framework\TestCase;
- class ConnectionTest extends TestCase
- {
-
- protected $connection;
- function setUp(): void
- {
- parent::setUp();
- $config = new Config(MYSQL_CONFIG);
- $this->connection = new Connection($config);
- }
- function testQuery()
- {
- $queryBuild = new QueryBuilder();
- $queryBuild->raw("show tables");
- $data = $this->connection->defer()->query($queryBuild);
- $this->assertTrue($data instanceof Result);
- }
-
- }
|