Page MenuHomeDevCentral

BootstrapSqliteRepositoryTest.php
No OneTemporary

BootstrapSqliteRepositoryTest.php

<?php
declare(strict_types=1);
namespace Nasqueron\SAAS\PhpBB\Tests\Tasks;
use Nasqueron\SAAS\PhpBB\Tasks\BootstrapSqliteRepository;
use Nasqueron\SAAS\PhpBB\Tests\Utilities\WithSqliteAssertions;
use PHPUnit\Framework\TestCase;
final class BootstrapSqliteRepositoryTest extends TestCase {
use WithSqliteAssertions;
/**
* @var string
*/
private $filename;
///
/// Fixtures
///
public function setUp () {
$this->filename = tempnam("", "test-db-");
}
public function tearDown () {
unlink($this->filename);
}
///
/// Tests
///
public function testBootstrap () : void {
$task = new BootstrapSqliteRepository($this->filename);
$task->run();
$this->assertDatabaseHasBeenCreated($this->filename);
}
public function testBootstrapWithDefaultFile () : void {
putenv("SAAS_SITES_DB=$this->filename"); // default file
$task = new BootstrapSqliteRepository();
$task->run();
$this->assertDatabaseHasBeenCreated($this->filename);
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Apr 2, 18:22 (12 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535304
Default Alt Text
BootstrapSqliteRepositoryTest.php (1 KB)

Event Timeline