SwooleTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Siam
  5. * Date: 2019/11/28
  6. * Time: 15:43
  7. */
  8. namespace EasySwoole\ORM\Tests;
  9. use PHPUnit\Framework\TestCase;
  10. use Swoole\Coroutine\MySQL;
  11. use EasySwoole\ORM\Tests\models\TestUserListModel;
  12. use EasySwoole\ORM\Tests\models\TestUserModel;
  13. use EasySwoole\ORM\Tests\models\TestTimeStampModel;
  14. use EasySwoole\ORM\Tests\models\TestFunctionFieldNameModel;
  15. use EasySwoole\ORM\Tests\models\TestRelationModel;
  16. use EasySwoole\ORM\Tests\models\TestUserEventModel;
  17. use EasySwoole\ORM\Tests\models\TestUserListGetterModel;
  18. class SwooleTest extends TestCase
  19. {
  20. /** @var MySQL */
  21. protected $client;
  22. protected function setUp(): void
  23. {
  24. parent::setUp(); // TODO: Change the autogenerated stub
  25. $swoole_mysql = new MySQL();
  26. $swoole_mysql->connect(MYSQL_CONFIG);
  27. $this->client = $swoole_mysql;
  28. }
  29. public function testInsert()
  30. {
  31. $false = $this->client->query("insert into user_test_list (ttttt) values (1)");
  32. $this->assertFalse($false);
  33. }
  34. }