34 lines
1.3 KiB
PowerShell
34 lines
1.3 KiB
PowerShell
$projectRoot = Split-Path -Parent $PSScriptRoot
|
|
$seedPath = Join-Path $projectRoot 'database\contao-baseline.sql'
|
|
$exportScriptPath = Join-Path $projectRoot 'scripts\Export-ContaoBaseline.ps1'
|
|
$importScriptPath = Join-Path $projectRoot 'scripts\Import-ContaoBaseline.ps1'
|
|
|
|
Describe 'Contao baseline' {
|
|
$seed = Get-Content -LiteralPath $seedPath -Raw
|
|
|
|
It 'starts without Contao 5 content data after the version reset' {
|
|
$seed | Should Not Match 'INSERT INTO `tl_'
|
|
}
|
|
|
|
It 'does not contain user, runtime or unversioned file metadata' {
|
|
$seed | Should Not Match 'INSERT INTO `tl_(user|session|log|lock|files)'
|
|
}
|
|
|
|
It 'uses the same approved table list in export and import scripts' {
|
|
$export = Get-Content -LiteralPath $exportScriptPath -Raw
|
|
$import = Get-Content -LiteralPath $importScriptPath -Raw
|
|
|
|
foreach ($table in @('tl_theme', 'tl_layout', 'tl_module', 'tl_page', 'tl_article', 'tl_content', 'tl_form', 'tl_form_field')) {
|
|
$export | Should Match $table
|
|
$import | Should Match $table
|
|
}
|
|
}
|
|
|
|
It 'asks before overwriting an existing baseline export' {
|
|
$export = Get-Content -LiteralPath $exportScriptPath -Raw
|
|
|
|
$export | Should Match 'Read-Host'
|
|
$export | Should Match 'überschreiben'
|
|
}
|
|
}
|