Skip to content

Commit 638bab9

Browse files
committed
Improve tests
1 parent b5ba184 commit 638bab9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/WP_SQLite_Driver_Tests.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9178,6 +9178,9 @@ public function testAlterTableAddCheckConstraint(): void {
91789178
// Insert valid data.
91799179
$this->assertQuery( 'INSERT INTO t (id) VALUES (1)' );
91809180

9181+
$result = $this->assertQuery( 'SELECT * FROM t' );
9182+
$this->assertCount( 1, $result );
9183+
91819184
// Insert invalid data.
91829185
$this->expectException( WP_SQLite_Driver_Exception::class );
91839186
$this->expectExceptionMessage( 'SQLSTATE[23000]: Integrity constraint violation: 19 CHECK constraint failed: c' );
@@ -9207,5 +9210,12 @@ public function testAlterTableDropCheckConstraint(): void {
92079210
),
92089211
$result[0]->{'Create Table'}
92099212
);
9213+
9214+
// Insert data that would violate the constraints.
9215+
$this->assertQuery( 'INSERT INTO t (id) VALUES (0)' );
9216+
$this->assertQuery( 'INSERT INTO t (id) VALUES (100)' );
9217+
9218+
$result = $this->assertQuery( 'SELECT * FROM t' );
9219+
$this->assertCount( 2, $result );
92109220
}
92119221
}

0 commit comments

Comments
 (0)