Skip to content

Commit

Permalink
Cleanup fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbochmann committed Jan 3, 2024
1 parent 3c862fa commit 1da1e2f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Tests/Classes/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ protected static function resetDebugger()
*/
protected static function addRules(array $rules)
{
Rules::addRulesForFrontend($rules);
Rules::addRulesForBackend($rules);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ public function processCallsMonitorCorrect()
$response->reveal(),
$middleware->process($request->reveal(), $handler->reveal())
);

self::assertInstanceOf(ServerRequestInterface::class, $GLOBALS['TYPO3_REQUEST']);
}

/**
Expand All @@ -99,8 +97,6 @@ public function processCallsMonitorCorrect()
*/
public function processCallsSanitizerCorrect()
{
self::assertNull($GLOBALS['TYPO3_REQUEST'] ?? null);

$this->setExtConf(['stealthMode' => '0']);

$middleware = new GlobalInputSanitizerMiddleware();
Expand Down Expand Up @@ -138,8 +134,6 @@ public function processCallsSanitizerCorrect()
$response->reveal(),
$middleware->process($request->reveal(), $handler->reveal())
);

self::assertInstanceOf(ServerRequestInterface::class, $GLOBALS['TYPO3_REQUEST']);
}

/**
Expand Down Expand Up @@ -189,7 +183,7 @@ function (ServerRequest $cleanedRequest) use ($sanitizedData) {
*
* @return array[]
*/
public function getProcessCallsSanitizerAndSanitizesCorrectByRulesData()
public static function getProcessCallsSanitizerAndSanitizesCorrectByRulesData()
{
return SanitizerTest::getSanitizeInputData();
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Classes/Utility/ConfigurationUtilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function getExtensionConfigurationLoadsCorrect(
*
* @return array[]
*/
public function getExtensionConfigurationLoadsCorrectData()
public static function getExtensionConfigurationLoadsCorrectData()
{
return [
__LINE__.':1,1,0,14' => [
Expand Down
2 changes: 1 addition & 1 deletion Tests/Classes/Utility/DebugUtilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function debugDoesNotEchoButDesctructDoes()
];

$echoDebugCall = -1;
$debugger = $this->getMockBuilder(DebugUtility::class)->setMethods(['echoDebug'])->getMock();
$debugger = $this->getMockBuilder(DebugUtility::class)->onlyMethods(['echoDebug'])->getMock();
$debugger
->expects($this->exactly(2))
->method('echoDebug')
Expand Down
55 changes: 19 additions & 36 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
<phpunit
backupGlobals="true"
backupStaticAttributes="false"
bootstrap=".Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php"
cacheResultFile=".Build/.phpunit.result.cache"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
>

<php>
<env name="TYPO3_PATH_APP" value=".Build" />
<env name="TYPO3_PATH_WEB" value=".Build/Web" />
</php>

<testsuites>
<testsuite name="Unit Tests">
<directory>Tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./hooks</directory>
<directory suffix=".php">./rules</directory>
<directory suffix=".php">./sanitizer</directory>
<directory suffix=".php">./util</directory>
</whitelist>
</filter>
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="true" bootstrap=".Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false" requireCoverageMetadata="false">
<php>
<env name="TYPO3_PATH_APP" value=".Build"/>
<env name="TYPO3_PATH_WEB" value=".Build/Web"/>
</php>
<testsuites>
<testsuite name="Unit Tests">
<directory>Tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./hooks</directory>
<directory suffix=".php">./rules</directory>
<directory suffix=".php">./sanitizer</directory>
<directory suffix=".php">./util</directory>
</include>
</source>
</phpunit>

0 comments on commit 1da1e2f

Please sign in to comment.