Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypoScript rules #176

Merged
merged 11 commits into from
Jun 26, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
config.disablePageExternalUrl = 1
config.disablePageExternalUrl = 0

config {
disablePageExternalUrl = 1
dummy = 1
}

config.foo = true
-----

config {
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace a9f\Typo3Fractor\Tests\TYPO3v12\TypoScript\RemoveConfigDisablePageExternalUrlOptionFractor;

use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigDisablePageExternalUrlFractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(RemoveConfigDisablePageExternalUrlFractor::class)]
final class RemoveConfigDisablePageExternalUrlFractorTest extends AbstractFractorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript');
}

public function provideConfigFilePath(): ?string
{
return __DIR__ . '/config/fractor.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigDisablePageExternalUrlFractor;

return FractorConfiguration::configure()
->withRules([RemoveConfigDisablePageExternalUrlFractor::class]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config.doctypeSwitch = 1

config {
doctypeSwitch = 1
dummy = 1
}

config.foo = true
-----

config {
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace a9f\Typo3Fractor\Tests\TYPO3v12\TypoScript\RemoveConfigDoctypeSwitchFractor;

use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigDoctypeSwitchFractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(RemoveConfigDoctypeSwitchFractor::class)]
final class RemoveConfigDoctypeSwitchFractorTest extends AbstractFractorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript');
}

public function provideConfigFilePath(): ?string
{
return __DIR__ . '/config/fractor.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigDoctypeSwitchFractor;

return FractorConfiguration::configure()
->withRules([RemoveConfigDoctypeSwitchFractor::class]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config.metaCharset = utf-8

config {
metaCharset = utf-8
dummy = 1
}

config.foo = true
-----

config {
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace a9f\Typo3Fractor\Tests\TYPO3v12\TypoScript\RemoveConfigMetaCharsetFractor;

use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigMetaCharsetFractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(RemoveConfigMetaCharsetFractor::class)]
final class RemoveConfigMetaCharsetFractorTest extends AbstractFractorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript');
}

public function provideConfigFilePath(): ?string
{
return __DIR__ . '/config/fractor.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigMetaCharsetFractor;

return FractorConfiguration::configure()
->withRules([RemoveConfigMetaCharsetFractor::class]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config.sendCacheHeaders_onlyWhenLoginDeniedInBranch = 1

config {
sendCacheHeaders_onlyWhenLoginDeniedInBranch = 0
dummy = 1
}

config.foo = true
-----

config {
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace a9f\Typo3Fractor\Tests\TYPO3v12\TypoScript\RemoveConfigSendCacheHeadersOnlyWhenLoginDeniedInBranchFractor;

use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigSendCacheHeadersOnlyWhenLoginDeniedInBranchFractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(RemoveConfigSendCacheHeadersOnlyWhenLoginDeniedInBranchFractor::class)]
final class RemoveConfigSendCacheHeadersOnlyWhenLoginDeniedInBranchFractorTest extends AbstractFractorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript');
}

public function provideConfigFilePath(): ?string
{
return __DIR__ . '/config/fractor.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigSendCacheHeadersOnlyWhenLoginDeniedInBranchFractor;

return FractorConfiguration::configure()
->withRules([RemoveConfigSendCacheHeadersOnlyWhenLoginDeniedInBranchFractor::class]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
config.spamProtectEmailAddresses = 2

config {
spamProtectEmailAddresses = -4
dummy = 1
}

config.foo = true
-----
config.spamProtectEmailAddresses = 2

config {
spamProtectEmailAddresses = -4
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config.spamProtectEmailAddresses = ascii

config {
spamProtectEmailAddresses = ascii
dummy = 1
}

config.foo = true
-----

config {
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace a9f\Typo3Fractor\Tests\TYPO3v12\TypoScript\RemoveConfigSpamProtectEmailAddressesAsciiOptionFractorTest;

use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigSpamProtectEmailAddressesAsciiOptionFractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(RemoveConfigSpamProtectEmailAddressesAsciiOptionFractor::class)]
final class RemoveConfigSpamProtectEmailAddressesAsciiOptionFractorTest extends AbstractFractorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript');
}

public function provideConfigFilePath(): ?string
{
return __DIR__ . '/config/fractor.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveConfigSpamProtectEmailAddressesAsciiOptionFractor;

return FractorConfiguration::configure()
->withRules([RemoveConfigSpamProtectEmailAddressesAsciiOptionFractor::class]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mod.web_layout.disableNewContentElementWizard = 1
mod.newContentElementWizard.override = 1

mod {
web_layout.disableNewContentElementWizard = 0
newContentElementWizard.override = 0
dummy = 1
}

config.foo = true
-----

mod {
dummy = 1
}

config.foo = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace a9f\Typo3Fractor\Tests\TYPO3v12\TypoScript\RemoveNewContentElementWizardOptionsFractor;

use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveNewContentElementWizardOptionsFractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(RemoveNewContentElementWizardOptionsFractor::class)]
final class RemoveNewContentElementWizardOptionsFractorTest extends AbstractFractorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript');
}

public function provideConfigFilePath(): ?string
{
return __DIR__ . '/config/fractor.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use a9f\Typo3Fractor\TYPO3v12\TypoScript\RemoveNewContentElementWizardOptionsFractor;

return FractorConfiguration::configure()
->withRules([RemoveNewContentElementWizardOptionsFractor::class]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
options.workspaces.swapMode = any
options.workspaces.swapMode = page
options.workspaces.changeStageMode = any
options.workspaces.changeStageMode = page

options {
workspaces.swapMode = any
workspaces.swapMode = page
workspaces.changeStageMode = any
workspaces.changeStageMode = page
dummy = 1
}

config.foo = true
-----

options {
dummy = 1
}

config.foo = true
Loading