DbTest.php 635 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace think\tests;
  3. use Mockery as m;
  4. use PHPUnit\Framework\TestCase;
  5. use think\Db;
  6. use think\db\connector\Mysql;
  7. class DbTest extends TestCase
  8. {
  9. protected function tearDown(): void
  10. {
  11. m::close();
  12. }
  13. /**
  14. * @dataProvider connectProvider
  15. * @param $config
  16. * @runInSeparateProcess
  17. * @preserveGlobalState disabled
  18. */
  19. public function testConnect($config)
  20. {
  21. $mysql = m::mock('overload:' . Mysql::class);
  22. $db = new Db($config);
  23. }
  24. public function connectProvider()
  25. {
  26. return [
  27. [['type' => 'mysql']],
  28. ];
  29. }
  30. }