diff --git a/tests/Unit/ActionRepositoryTest.php b/tests/Unit/ActionRepositoryTest.php index 3b9e316..77ede40 100644 --- a/tests/Unit/ActionRepositoryTest.php +++ b/tests/Unit/ActionRepositoryTest.php @@ -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 );