diff --git a/composer.json b/composer.json index 4430e2b..dd25b53 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "phpbb-extension", "description": "Knowledge Base", "homepage": "https://www.phpbbmodders.com/", - "version": "2.0.29", + "version": "2.1.0-a1-dev", "keywords": [ "phpbb", "extension", diff --git a/docs/testing.md b/docs/testing.md index ca021d5..6395c09 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1353,7 +1353,7 @@ A 43-check browser run (`kb-recent-changes-test.js`) covers the setting's three ones, the order matching the database's own (edit or write time, newest first, ties by id), **Updated** exactly on the edited articles with the edited one first, both feeds parsing as XML with 50 entries in the page's order and times that never increase, absolute article links, the first entry opening the newest article, markup characters in a title and a description (`Fish & "tasty" Übersicht`, `R&D bold`) arriving as the real characters and shown as text, "RSS only" and "Atom only" each giving 200 and 404 and dropping the other link from the header and the page, a guest getting 403 until guests may read and then both feeds and the page, a member denied the Knowledge Base getting 403 and a refusal page with no header links, and the other tabs keeping their own selection. The fixtures hold no edited article, so the run edits one and puts it back. It passes on phpBB 3.3.19 and -4.0.0-a3-dev with SQLite, MySQL 8.0 and PostgreSQL 16 (six boards, 43 of 43 on each). The tab layout run (selected tab in the board's header colours, no overflow at 1100 and 390 pixels, three styles, flat and hierarchical, Slate) still passes (23 of 23) on the 3.3 SQLite board; it cannot sign in to the 4.0 SQLite board. +4.0.0-a3-dev with SQLite, MySQL 8.0 and PostgreSQL 16 (six boards, 43 of 43 on each). The tab layout run (selected tab in the board's header colours, no overflow at 1100 and 390 pixels, three styles, flat and hierarchical, Slate) still passes (23 of 23) on the 3.3 and 4.0 SQLite boards. `kb_feed_test.php` (the wiki's feed cases: formats offered, valid settings, both documents well formed with values escaped once, an empty feed) and `kb_recent_changes_test.php` (the migration; 403 without running a query, 404 for a format not offered, the feed built from given rows with its headers and New or Updated summaries, the query's live-only conditions and ordering, and the routes, service, tab, header template, ACP and language strings being wired in) are new; the style layout test now expects the extra tab. The suite passes with 485 tests (17 skipped: database cases without the MySQL and PostgreSQL fixtures, which this change does not touch). diff --git a/tests/kb_hierarchical_default_test.php b/tests/kb_hierarchical_default_test.php index 3d521c0..0822bf1 100644 --- a/tests/kb_hierarchical_default_test.php +++ b/tests/kb_hierarchical_default_test.php @@ -46,13 +46,15 @@ public function test_the_migration_is_skipped_once_the_setting_exists_and_revert $this->assertSame(['config.add:kb_flat_index', 'config.remove:kb_hierarchical_index', 'config.update:kb_version'], $reverted); } - public function test_the_extension_version_matches_the_last_migration() + public function test_the_extension_version_is_not_older_than_the_last_migration() { + // composer.json holds the release version (a rolling -dev prerelease); the migrations' + // own numbers only mark the database schema through the kb_version setting. $composer = json_decode(file_get_contents(self::ROOT . '/composer.json'), true); $versions = array_map(fn($file) => str_replace('_', '.', substr(basename($file, '.php'), strlen('version_'))), glob(self::ROOT . '/migrations/version_*.php')); usort($versions, 'version_compare'); - $this->assertSame(end($versions), $composer['version']); + $this->assertTrue(version_compare($composer['version'], end($versions), '>='), $composer['version'] . ' is older than the last migration ' . end($versions)); } /** @dataProvider code_that_reads_the_setting */