Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ phpBB boards require a web server running PHP and one of the following database
|----------------|---------------|--------|---------|------------|----------------|--------------|
| 4.0.0 (alpha) | 8.2+ | 8.0+ | 10.2.7+ | 9.5+ | SQLite 3.8.3+ | Server 2012+ |
| 3.3.11 - 3.3.x | 7.2.0 - 8.x | 4.1.3+ | 5.1+ | 8.3+ | SQLite 3.6.15+ | Server 2000+ |
| 3.3.0 - 3.3.10 | 7.1.3 - 8.x | 4.1.3+ | 5.1+ | 8.3+ | SQLite 3.6.15+ | Server 2000+ |
| 3.3.6 - 3.3.10 | 7.1.3 - 8.x | 4.1.3+ | 5.1+ | 8.3+ | SQLite 3.6.15+ | Server 2000+ |
| 3.3.0 - 3.3.5 | 7.1.3 - 7.4 | 4.1.3+ | 5.1+ | 8.3+ | SQLite 3.6.15+ | Server 2000+ |
| 3.2.2 - 3.2.11 | 5.4.7 - 7.2.x | 3.23+ | 5.1+ | 8.3+ | SQLite 3.6.15+ | Server 2000+ |
| 3.2.0 - 3.2.1 | 5.4.7 - 7.1.x | 3.23+ | 5.1+ | 8.3+ | SQLite 3.6.15+ | Server 2000+ |
| 3.1.x | 5.4.7 - 5.6.x | 3.23+ | 5.1+ | 8.3+ | SQLite 2 or 3 | Server 2000+ |
Expand Down
3 changes: 2 additions & 1 deletion src/QuickInstall/Sandbox/DockerComposeWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ private function installConfig(string $name, array $config): string
server_name: $serverName
server_port: {$config['port']}
script_path: $scriptPath
extensions: []
# phpBB treats an empty list as "enable all available extensions".
extensions: ["__quickinstall_none__"]

YAML;
}
Expand Down
10 changes: 5 additions & 5 deletions src/QuickInstall/Sandbox/VersionMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class VersionMatrix
public function list(): array
{
return [
['selector' => 'latest', 'resolves_to' => '3.3.*', 'status' => 'supported', 'php' => '8.1', 'notes' => 'Default supported stable line'],
['selector' => '3.3 / 3.3.x', 'resolves_to' => '3.3.* or exact tag', 'status' => 'supported', 'php' => '8.1', 'notes' => 'Recommended; exact 3.3.0-3.3.4 use PHP 7.4'],
['selector' => 'latest', 'resolves_to' => '3.3.*', 'status' => 'supported', 'php' => '8.2', 'notes' => 'Default supported stable line'],
['selector' => '3.3 / 3.3.x', 'resolves_to' => '3.3.* or exact tag', 'status' => 'supported', 'php' => '8.2', 'notes' => 'Recommended; exact 3.3.0-3.3.5 use PHP 7.4'],
['selector' => '3.2 / 3.2.x', 'resolves_to' => '3.2.* or exact tag', 'status' => 'supported', 'php' => '7.1', 'notes' => 'Legacy-modern'],
['selector' => '4.0.x / master', 'resolves_to' => 'exact tag or dev-master', 'status' => 'experimental', 'php' => '8.2', 'notes' => 'Installer may change upstream'],
['selector' => '3.0.x / 3.1.x', 'resolves_to' => '-', 'status' => 'unsupported', 'php' => '-', 'notes' => 'Use legacy web app'],
Expand Down Expand Up @@ -60,7 +60,7 @@ public function resolve(string $requested, bool $git = false): array
'constraint' => '3.3.*',
'branch' => '3.3',
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'status' => 'supported',
];
}
Expand All @@ -73,7 +73,7 @@ public function resolve(string $requested, bool $git = false): array
'constraint' => '3.3.*',
'branch' => '3.3',
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'status' => 'supported',
];
}
Expand Down Expand Up @@ -112,7 +112,7 @@ public function resolve(string $requested, bool $git = false): array
'constraint' => $requested,
'branch' => '3.3',
'phpbb_branch' => '3.3',
'php' => version_compare($requested, '3.3.5', '<') ? '7.4' : '8.1',
'php' => version_compare($requested, '3.3.6', '<') ? '7.4' : '8.2',
'status' => 'supported',
];
}
Expand Down
14 changes: 7 additions & 7 deletions tests/Integration/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public function testBoardCreateValidationRunsBeforeExternalFetch(): void
public function testBoardCreateAllowsSupportedSqliteSeedPreset(): void
{
$root = $this->createTempProjectRoot();
$this->addDownloadedSource($root, '3.3.14');
$this->addDownloadedSource($root, '3.3.19');

$result = $this->runApplication($root, [
'qi', 'board:create', 'demo', '--phpbb', '3.3.14', '--db', 'sqlite', '--populate', 'development',
'qi', 'board:create', 'demo', '--phpbb', '3.3.19', '--db', 'sqlite', '--populate', 'development',
], "n\n");

self::assertSame(0, $result['exit_code']);
Expand All @@ -142,9 +142,9 @@ public function testBoardCreateRejectsHeavySqliteSeedPreset(): void
public function testBoardCreatePromptsToStartBoardAfterNextStep(): void
{
$root = $this->createTempProjectRoot();
$this->addDownloadedSource($root, '3.3.14');
$this->addDownloadedSource($root, '3.3.19');

$result = $this->runApplication($root, ['qi', 'board:create', 'demo', '--phpbb', '3.3.14', '--port', (string) $this->availablePort()], "n\n");
$result = $this->runApplication($root, ['qi', 'board:create', 'demo', '--phpbb', '3.3.19', '--port', (string) $this->availablePort()], "n\n");

self::assertSame(0, $result['exit_code']);
self::assertStringContainsString('NEXT:', $result['output']);
Expand All @@ -162,9 +162,9 @@ public function testBoardCreateDefaultsStartPromptToYes(): void
public function testBoardCreateRepeatsStartPromptUntilYesOrNo(): void
{
$root = $this->createTempProjectRoot();
$this->addDownloadedSource($root, '3.3.14');
$this->addDownloadedSource($root, '3.3.19');

$result = $this->runApplication($root, ['qi', 'board:create', 'demo', '--phpbb', '3.3.14', '--port', (string) $this->availablePort()], "maybe\nn\n");
$result = $this->runApplication($root, ['qi', 'board:create', 'demo', '--phpbb', '3.3.19', '--port', (string) $this->availablePort()], "maybe\nn\n");

self::assertSame(0, $result['exit_code']);
self::assertMatchesRegularExpression('#URL after start: http://localhost:\d+/demo/#', $result['output']);
Expand Down Expand Up @@ -286,7 +286,7 @@ private function addDownloadedSource(string $root, string $version): void
'constraint' => $version,
'branch' => $version,
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'status' => 'supported',
'type' => 'composer',
'package' => 'phpbb/phpbb',
Expand Down
48 changes: 24 additions & 24 deletions tests/Integration/WebApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public function testRenderShowsProjectState(): void
$root = $this->createTempProjectRoot();
$project = new Project($root);
$project->init();
$this->addDownloadedSource($project, '3.3.14');
$this->addDownloadedSource($project, '3.3.19');
$project->appendBoard([
'name' => 'demo',
'phpbb' => '3.3.14',
'phpbb_source' => '3.3.14',
'phpbb' => '3.3.19',
'phpbb_source' => '3.3.19',
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'db' => 'mariadb',
'port' => 8081,
'url' => 'http://localhost:8081/',
Expand All @@ -69,7 +69,7 @@ public function testRenderShowsProjectState(): void
self::assertStringContainsString('QuickInstall Dashboard', $text);
self::assertStringContainsString('demo', $text);
self::assertStringContainsString('http://localhost:8081/', $text);
self::assertStringContainsString('3.3.14', $text);
self::assertStringContainsString('3.3.19', $text);
self::assertStringContainsString('vendor/one', $text);
self::assertStringContainsString('vendor/four', $text);
}
Expand All @@ -83,9 +83,9 @@ public function testRenderListsEveryBoard(): void
{
$project->appendBoard([
'name' => 'board-' . $index,
'phpbb' => '3.3.17',
'phpbb_source' => '3.3.17',
'php' => '8.1',
'phpbb' => '3.3.19',
'phpbb_source' => '3.3.19',
'php' => '8.2',
'db' => 'mariadb',
'port' => 8100 + $index,
'url' => 'http://localhost:' . (8100 + $index) . '/',
Expand All @@ -110,8 +110,8 @@ public function testRunningBoardRendersOneStopAction(): void
{
$html = $this->renderDashboard([[
'name' => 'demo',
'phpbb' => '3.3.17',
'php' => '8.1',
'phpbb' => '3.3.19',
'php' => '8.2',
'db' => 'mariadb',
'url' => 'http://localhost:8080/',
'populate' => 'none',
Expand All @@ -131,8 +131,8 @@ public function testBoardUrlIsLinkedOnlyWhileRunning(): void
{
$board = [
'name' => 'demo',
'phpbb' => '3.3.17',
'php' => '8.1',
'phpbb' => '3.3.19',
'php' => '8.2',
'db' => 'mariadb',
'url' => 'http://localhost:8080/',
'populate' => 'none',
Expand All @@ -154,7 +154,7 @@ public function testBoardCreateRejectsHeavySqliteSeedPreset(): void
$json = $this->runWebApplicationWithCsrf($root, [
'action' => 'board_create',
'name' => 'demo',
'phpbb' => '3.3.14',
'phpbb' => '3.3.19',
'db' => 'sqlite',
'port' => '8080',
'populate' => 'load-test',
Expand Down Expand Up @@ -310,17 +310,17 @@ public function testAjaxSourceRemoveDeletesSource(): void
$root = $this->createTempProjectRoot();
$project = new Project($root);
$project->init();
$this->addDownloadedSource($project, '3.3.14');
$this->addDownloadedSource($project, '3.3.19');

$json = $this->runWebApplicationWithCsrf($root, [
'action' => 'source_remove',
'source' => '3.3.14',
'source' => '3.3.19',
], true);
$data = json_decode($json, true);

self::assertIsArray($data);
self::assertTrue($data['ok']);
self::assertSame('Removed source: 3.3.14', $data['notice']);
self::assertSame('Removed source: 3.3.19', $data['notice']);
self::assertSame([], $project->readJson('sources.json', []));
}

Expand All @@ -329,13 +329,13 @@ public function testAjaxExtensionMountReturnsJsonError(): void
$root = $this->createTempProjectRoot();
$project = new Project($root);
$project->init();
$this->addDownloadedSource($project, '3.3.14');
$this->addDownloadedSource($project, '3.3.19');
$project->appendBoard([
'name' => 'demo',
'phpbb' => '3.3.14',
'phpbb_source' => '3.3.14',
'phpbb' => '3.3.19',
'phpbb_source' => '3.3.19',
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'db' => 'mariadb',
'port' => 8081,
'url' => 'http://localhost:8081/',
Expand Down Expand Up @@ -379,13 +379,13 @@ public function testRenderShowsProjectRelativeSourcePaths(): void
$root = $this->createTempProjectRoot();
$project = new Project($root);
$project->init();
$this->addDownloadedSource($project, '3.3.14');
$this->addDownloadedSource($project, '3.3.19');

$html = $this->runWebApplication($root);
$text = $this->visibleText($html);

self::assertStringContainsString('/' . basename($root) . '/.qi/sources/phpbb-3.3.14', $text);
self::assertStringNotContainsString($root . '/.qi/sources/phpbb-3.3.14', $text);
self::assertStringContainsString('/' . basename($root) . '/.qi/sources/phpbb-3.3.19', $text);
self::assertStringNotContainsString($root . '/.qi/sources/phpbb-3.3.19', $text);
}

public function testRenderShowsCachedUpdateBanner(): void
Expand Down Expand Up @@ -576,7 +576,7 @@ private function addDownloadedSource(Project $project, string $key): void
'constraint' => $key,
'branch' => '3.3',
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'status' => 'supported',
'type' => 'composer',
'package' => 'phpbb/phpbb',
Expand Down
40 changes: 20 additions & 20 deletions tests/Unit/BoardServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class BoardServiceTest extends TestCase

public function testCreateWritesBoardAndRuntimeConfig(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$runner = new ServiceTestBoardRunner($project);
$service = new TestBoardService($project, $runner);

$result = $service->create('demo', '3.3.14', 'postgres', 8090, 'tiny', true);
$result = $service->create('demo', '3.3.19', 'postgres', 8090, 'tiny', true);

self::assertSame('demo', $result['board']['name']);
self::assertSame('postgres', $result['board']['db']);
Expand All @@ -47,7 +47,7 @@ public function testHostTimezoneUsesPhpCompatibleEnvironmentValue(): void

try
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
self::assertSame('US/Pacific', (new HostTimezoneTestBoardService($project))->detectedHostTimezone());
}
finally
Expand All @@ -58,39 +58,39 @@ public function testHostTimezoneUsesPhpCompatibleEnvironmentValue(): void

public function testCreateRejectsDuplicateWithoutReplace(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo', 'port' => 8090]);

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Board already exists');

(new TestBoardService($project))->create('demo', '3.3.14', 'mariadb', 8090);
(new TestBoardService($project))->create('demo', '3.3.19', 'mariadb', 8090);
}

public function testRejectsBoardNamesThatDifferOnlyByCase(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'Demo', 'port' => 8090]);

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('case-insensitive');
(new TestBoardService($project))->create('demo', '3.3.14', 'mariadb', 8091);
(new TestBoardService($project))->create('demo', '3.3.19', 'mariadb', 8091);
}

public function testCreateWithReplacePreservesExistingBoardUntilReplacementIsReady(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo', 'port' => 8090]);
$runner = new ServiceTestBoardRunner($project);

(new TestBoardService($project, $runner))->create('demo', '3.3.14', 'mariadb', 8090, 'none', false, true);
(new TestBoardService($project, $runner))->create('demo', '3.3.19', 'mariadb', 8090, 'none', false, true);

self::assertSame(['demo'], $runner->preparedForReplacement);
}

public function testFailedReplacementRestoresExistingBoardFiles(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo', 'port' => 8090]);
mkdir($project->boardPath('demo'), 0775, true);
file_put_contents($project->boardPath('demo') . '/existing.txt', 'preserved');
Expand All @@ -99,7 +99,7 @@ public function testFailedReplacementRestoresExistingBoardFiles(): void

try
{
(new TestBoardService($project, $runner, false, $writer))->create('demo', '3.3.14', 'mariadb', 8090, 'none', false, true);
(new TestBoardService($project, $runner, false, $writer))->create('demo', '3.3.19', 'mariadb', 8090, 'none', false, true);
self::fail('Expected replacement failure.');
}
catch (\RuntimeException $e)
Expand Down Expand Up @@ -136,28 +136,28 @@ public function testCreateCanUseRegisteredCustomSourceKey(): void

public function testCreateRejectsUsedPortAndHostPort(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'other', 'port' => 8090]);

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Port 8090 is already used by board: other');

(new TestBoardService($project))->create('demo', '3.3.14', 'mariadb', 8090);
(new TestBoardService($project))->create('demo', '3.3.19', 'mariadb', 8090);
}

public function testCreateRejectsHostPortInUse(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Port 8090 is already in use on this host.');

(new TestBoardService($project, null, true))->create('demo', '3.3.14', 'mariadb', 8090);
(new TestBoardService($project, null, true))->create('demo', '3.3.19', 'mariadb', 8090);
}

public function testListAddsRunnerStatusAndDefaults(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo']);
$runner = new ServiceTestBoardRunner($project);
$runner->statuses['demo'] = 'running';
Expand All @@ -171,7 +171,7 @@ public function testListAddsRunnerStatusAndDefaults(): void

public function testStartStopDestroyAndSeedDelegateToRunner(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo', 'db' => 'mariadb']);
$runner = new ServiceTestBoardRunner($project);
$runner->statuses['demo'] = 'running';
Expand All @@ -190,7 +190,7 @@ public function testStartStopDestroyAndSeedDelegateToRunner(): void

public function testSeedRequiresRunningBoard(): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo', 'db' => 'mariadb']);
$runner = new ServiceTestBoardRunner($project);
$runner->statuses['demo'] = 'stopped';
Expand All @@ -206,7 +206,7 @@ public function testSeedRequiresRunningBoard(): void
*/
public function testSqliteSeedActionRules(string $preset, string $action, bool $allowed): void
{
$project = $this->projectWithSource('3.3.14');
$project = $this->projectWithSource('3.3.19');
$project->appendBoard(['name' => 'demo', 'db' => 'sqlite']);
$runner = new ServiceTestBoardRunner($project);
$runner->statuses['demo'] = 'running';
Expand Down Expand Up @@ -251,7 +251,7 @@ private function projectWithSource(string $version, ?string $osFamily = null): P
'constraint' => $version,
'branch' => '3.3',
'phpbb_branch' => '3.3',
'php' => '8.1',
'php' => '8.2',
'status' => 'supported',
'type' => 'composer',
'package' => 'phpbb/phpbb',
Expand Down
Loading
Loading