Skip to content

Commit c708864

Browse files
committed
fix(http): publish migration during database session driver installation
1 parent 174044c commit c708864

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

packages/http/src/Session/Installer/DatabaseSessionInstaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131
public function install(): void
3232
{
3333
$migration = $this->publish(
34-
source: __DIR__ . '/CreateSessionsTable.stub.php',
34+
source: __DIR__ . '/CreateSessionsTable.php',
3535
destination: src_path('Sessions/CreateSessionsTable.php'),
3636
);
3737

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tests\Tempest\Integration\Http;
6+
7+
use PHPUnit\Framework\Attributes\PostCondition;
8+
use PHPUnit\Framework\Attributes\PreCondition;
9+
use PHPUnit\Framework\Attributes\Test;
10+
use Tempest\Support\Namespace\Psr4Namespace;
11+
use Tests\Tempest\Integration\FrameworkIntegrationTestCase;
12+
13+
/**
14+
* @internal
15+
*/
16+
final class DatabaseSessionInstallerTest extends FrameworkIntegrationTestCase
17+
{
18+
#[PreCondition]
19+
protected function configure(): void
20+
{
21+
$this->installer
22+
->configure(__DIR__ . '/install', new Psr4Namespace('App\\', __DIR__ . '/install/App'))
23+
->setRoot(__DIR__ . '/install');
24+
}
25+
26+
#[PostCondition]
27+
protected function cleanup(): void
28+
{
29+
$this->installer->clean();
30+
}
31+
32+
#[Test]
33+
public function installer(): void
34+
{
35+
$this->console->call('install sessions:database -f --no-migrate');
36+
37+
$this->installer
38+
->assertFileExists('App/Sessions/CreateSessionsTable.php')
39+
->assertFileExists('App/Sessions/session.config.php');
40+
}
41+
}

0 commit comments

Comments
 (0)