Skip to content

Commit c41df63

Browse files
NHZEXliu21st
authored andcommitted
修复测试
1 parent 6811bbd commit c41df63

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/TestCaseBase.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TestCaseBase extends TestCase
2020
{
2121
protected ConnectionInterface $db;
2222
protected static string $connectName;
23-
protected bool $isPgScriptInstalled = false;
23+
protected static bool $isResetPgScript = false;
2424

2525
protected static function initModelSupport(): void
2626
{
@@ -44,10 +44,12 @@ public function setUp(): void
4444
{
4545
$this->db ??= Db::connect(static::$connectName);
4646

47-
if (static::$connectName === 'pgsql' && $this->isPgScriptInstalled) {
48-
pg_reset_function();
47+
if (static::$connectName === 'pgsql') {
48+
if (self::$isResetPgScript === false) {
49+
pg_reset_function();
50+
self::$isResetPgScript = true;
51+
}
4952
pg_install_func();
50-
$this->isPgScriptInstalled = true;
5153
}
5254

5355
// var_dump(static::class . '-' . __FUNCTION__ . '-' . spl_object_id($this));

tests/orm/ModelFieldTypeBase.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ public function testInitData(): array
4141
*/
4242
public function testFieldTypeSelect(array $data)
4343
{
44-
var_dump($this->db->getTableFieldsInfo('test_field_type'));
45-
var_dump($this->db->getSchemaInfo('test_field_type'));
46-
var_dump($this->db->getFieldBindType('bigint'));
47-
4844
$result = $this->db->table('test_field_type')->setFieldType(['bigint' => 'string'])->select();
4945
$this->assertNotEmpty($result->count());
5046
foreach ($data as $index => $item) {

0 commit comments

Comments
 (0)