Skip to content

Commit 78d9457

Browse files
committed
hyperf/test \PHPUnit\Framework\TestCase
1 parent 06b2c7f commit 78d9457

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

test/Cases/MysqlProxyConnectionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Hyperf\Context\ApplicationContext;
88
use Hyperf\DbConnection\Db;
9-
use HyperfTest\TestCase;
109
use PHPUnit\Framework\Assert;
1110
use Swoole\Coroutine;
1211
use Swoole\Process;
@@ -15,7 +14,7 @@
1514
* MySQL代理连接测试
1615
* 验证通过代理服务连接到MySQL容器并执行查询
1716
*/
18-
class MysqlProxyConnectionTest extends TestCase
17+
class MysqlProxyConnectionTest extends \PHPUnit\Framework\TestCase
1918
{
2019
// 代理服务器进程
2120
private ?Process $proxyProcess = null;

test/origin/test_proxy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// 测试1: 连接到代理
1212
echo "测试1: 连接到代理服务(使用 proxy_user 账号)...\n";
1313
try {
14-
$dsn = "mysql:host=127.0.0.1;port=3307";
15-
$pdo = new PDO($dsn, "proxy_user", "");
14+
$dsn = "mysql:host=127.0.0.1;port=3308";
15+
$pdo = new PDO($dsn, "proxy_user", "proxy_pass");
1616
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
1717
echo "✅ 通过代理连接成功!\n\n";
1818
} catch (PDOException $e) {

0 commit comments

Comments
 (0)