Files
michaelschiemer/tests/Unit/Framework/Attributes/StaticPageTest.php

39 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use App\Framework\Attributes\StaticPage;
describe('StaticPage', function () {
it('constructs with default values', function () {
$staticPage = new StaticPage();
expect($staticPage->outputPath)->toBeNull();
expect($staticPage->prerender)->toBeTrue();
});
it('constructs with custom output path', function () {
$staticPage = new StaticPage(outputPath: 'custom/path/index.html');
expect($staticPage->outputPath)->toBe('custom/path/index.html');
expect($staticPage->prerender)->toBeTrue();
});
it('constructs with prerender disabled', function () {
$staticPage = new StaticPage(prerender: false);
expect($staticPage->outputPath)->toBeNull();
expect($staticPage->prerender)->toBeFalse();
});
it('constructs with all parameters', function () {
$staticPage = new StaticPage(
outputPath: 'static/pages/about.html',
prerender: false
);
expect($staticPage->outputPath)->toBe('static/pages/about.html');
expect($staticPage->prerender)->toBeFalse();
});
});