Test: schema version assertion is a minimum, not an exact value
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
da1365f060
commit
1c6d93ad5f
1 file changed
+2
-1
@@ -67,7 +67,8 @@ final class ActionRepositoryTest extends TestCase {
|
||||
|
||||
public function test_installer_schema_defines_both_tables_and_unique_key(): void {
|
||||
$src = (string) file_get_contents( dirname( __DIR__, 2 ) . '/includes/Core/Installer.php' );
|
||||
$this->assertStringContainsString( "DB_VERSION = '2'", $src );
|
||||
$this->assertSame( 1, preg_match( "/DB_VERSION = '(\\d+)'/", $src, $m ), 'DB_VERSION constant not found' );
|
||||
$this->assertGreaterThanOrEqual( 2, (int) $m[1], 'the actions tables arrived in schema version 2; later versions must keep them' );
|
||||
$this->assertStringContainsString( 'CREATE TABLE {$p}actions (', $src );
|
||||
$this->assertStringContainsString( 'CREATE TABLE {$p}action_events (', $src );
|
||||
$this->assertStringContainsString( 'UNIQUE KEY donation_action (donation_id,action_id)', $src );
|
||||
|
||||
Reference in new issue
Block a user