Skip to content

Commit

Permalink
WIP: fixed functional and unit tests, converted xml to csv, added tes…
Browse files Browse the repository at this point in the history
…t xmls
  • Loading branch information
AndreAOE committed Jul 18, 2024
1 parent 4075afb commit e19ab24
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 26 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ nbproject
composer.lock
.php_cs.cache
var
.cache
# PHPUnit Reports
Tests/reports
reports
.cache
.phpunit.cache
.phpunit.result.cache
4 changes: 2 additions & 2 deletions Classes/Controller/BackendModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BackendModuleController extends ActionController
/**
* @var ModuleTemplateFactory
*/
protected ModuleTemplateFactory $moduleTemplateFactory;
public $moduleTemplateFactory;

/**
* BackendTemplateContainer
Expand All @@ -62,7 +62,7 @@ class BackendModuleController extends ActionController
/**
* @var CacheManager
*/
private $cacheManager;
private object $cacheManager;

/**
* @var LanguageService
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ And then open `Documentation-GENERATED-temp/Result/project/0.0.0/Index.html` wit

## Copyright / License

Copyright: (c) 2009 - 2019, Kasper Skaarhoj & AOE GmbH
Copyright: (c) 2009 - 2024, Kasper Skaarhoj & AOE GmbH
License: GPLv3, <http://www.gnu.org/licenses/gpl-3.0.en.html>

[1]: http://typo3.org/extensions/repository/view/cachemgm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function setUp(): void

public function testCountRowsInTable(): void
{
$this->importDataSet(__DIR__ . '/Fixtures/cache_pages.xml');
$this->importCSVDataSet(__DIR__ . '/Fixtures/cache_pages.csv');
$this->assertSame(
2,
$this->subject->countRowsInTable('cache_pages')
Expand Down
4 changes: 4 additions & 0 deletions Tests/Functional/Domain/Repository/Fixtures/cache_pages.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cache_pages,,,
,id,identifier,content
,1,c4355df29142213662c0561fe304de25,this-is-a-string-in-md5
,2,f9982c771f6d32fe6830b4b3c2ef646a,this-is-another-string-in-md5
13 changes: 0 additions & 13 deletions Tests/Functional/Domain/Repository/Fixtures/cache_pages.xml

This file was deleted.

34 changes: 34 additions & 0 deletions Tests/Functional/FunctionalTests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
backupGlobals="true"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
requireCoverageMetadata="false">
<coverage>
<report>
<clover outputFile="../reports/php_functionaltests/coverage_clover.xml"/>
<html outputDirectory="../reports/php_functionaltests/coverage/" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<logging>
<junit outputFile="../reports/php_functionaltests/coverage_junit.xml"/>
<testdoxHtml outputFile="../reports/php_functionaltests/testdox.html"/>
</logging>
<source>
<include>
<directory>../../Classes</directory>
</include>
</source>
</phpunit>
25 changes: 25 additions & 0 deletions Tests/Unit/UnitTests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
requireCoverageMetadata="false"
>
<source>
<include>
<directory suffix=".php">../Classes</directory>
</include>
</source>
</phpunit>
6 changes: 0 additions & 6 deletions code-quality/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,8 @@
])
->withSkip([
RecastingRemovalRector::class,
PostIncDecToPreIncDecRector::class,
FinalizeClassesWithoutChildrenRector::class,
ChangeAndIfToEarlyReturnRector::class,
IssetOnPropertyObjectToPropertyExistsRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
RenameVariableToMatchNewTypeRector::class,
AddLiteralSeparatorToNumberRector::class,
RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class,
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__ . '/../Classes/Service/Typo3Service.php',
],// @todo strict php
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
],
"test:unit": [
"[ -e .Build/bin/phpunit ] || composer update",
"TYPO3_PATH_WEB=$PWD/.Build/Web .Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests-v10.xml Tests/Unit"
"XDEBUG_MODE=coverage TYPO3_PATH_WEB=$PWD/.Build/Web .Build/bin/phpunit -c Tests/Unit/UnitTests.xml Tests/Unit"
],
"test:functional": [
"[ -e .Build/bin/phpunit ] || composer update",
"TYPO3_PATH_WEB=$PWD/.Build/Web typo3DatabaseName=cachemgm typo3DatabaseHost=127.0.0.1 typo3DatabaseUsername=root typo3DatabasePassword=root .Build/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests-v10.xml Tests/Functional/"
"XDEBUG_MODE=coverage TYPO3_PATH_WEB=$PWD/.Build/Web typo3DatabaseName=cachemgm typo3DatabaseHost=127.0.0.1 typo3DatabaseUsername=root typo3DatabasePassword=root .Build/bin/phpunit -c Tests/Functional/FunctionalTests.xml Tests/Functional/"
],
"test:all": [
"@test:unit",
Expand Down

0 comments on commit e19ab24

Please sign in to comment.