Skip to content

Commit

Permalink
[TASK] Update PHPUnit and testing framework
Browse files Browse the repository at this point in the history
Updates to phpunit/phpunit 11.4 and to current dev version
of TYPO3 testing framework for TYPO3 13 LTS.
  • Loading branch information
dkd-friedrich committed Oct 7, 2024
1 parent 4db9ed9 commit e38da56
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Build/Test/IntegrationTests.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"
backupGlobals="true"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
Expand All @@ -13,12 +13,13 @@
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnNotice="true"
failOnPhpunitDeprecation="true"
failOnRisky="true"
failOnWarning="true"
requireCoverageMetadata="false"
processIsolation="true"
>
<coverage includeUncoveredFiles="false"></coverage>
<coverage></coverage>
<source>
<include>
<directory>../../Classes</directory>
Expand Down
3 changes: 2 additions & 1 deletion Build/Test/UnitTests.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"
backupGlobals="true"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php"
Expand All @@ -13,6 +13,7 @@
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnNotice="true"
failOnPhpunitDeprecation="true"
failOnRisky="true"
failOnWarning="true"
requireCoverageMetadata="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace ApacheSolrForTypo3\Tika\Tests\Unit\Service\Tika;

use ApacheSolrForTypo3\Tika\Service\Tika\AbstractService;
use ApacheSolrForTypo3\Tika\Tests\Unit\UnitTestCase;

/*
Expand All @@ -23,17 +22,19 @@
use PHPUnit\Framework\Attributes\Test;

/**
* Class AbstractServiceTest
* Base test class AbstractServiceTestBase
*/
class AbstractServiceTest extends UnitTestCase
abstract class AbstractServiceTestBase extends UnitTestCase
{
protected string $serviceClass = '';

#[Test]
public function constructorCallsInitializeService(): void
{
$service = $this->getMockBuilder(AbstractService::class)
$service = $this->getMockBuilder($this->serviceClass)
->onlyMethods(['initializeService'])
->disableOriginalConstructor()
->getMockForAbstractClass();
->getMock();

$service->expects(self::once())
->method('initializeService');
Expand Down
28 changes: 28 additions & 0 deletions Tests/Unit/Service/Tika/AppServiceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Tests\Unit\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/

use ApacheSolrForTypo3\Tika\Service\Tika\AppService;

/**
* Class AppServiceTest
*/
class AppServiceTest extends AbstractServiceTestBase
{
protected string $serviceClass = AppService::class;
}
28 changes: 28 additions & 0 deletions Tests/Unit/Service/Tika/ServerServiceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Tests\Unit\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/

use ApacheSolrForTypo3\Tika\Service\Tika\ServerService;

/**
* Class ServerServiceTest
*/
class ServerServiceTest extends AbstractServiceTestBase
{
protected string $serviceClass = ServerService::class;
}
28 changes: 28 additions & 0 deletions Tests/Unit/Service/Tika/SolrCellServiceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Tests\Unit\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/

use ApacheSolrForTypo3\Tika\Service\Tika\SolrCellService;

/**
* Class SolrCellServiceTest
*/
class SolrCellServiceTest extends AbstractServiceTestBase
{
protected string $serviceClass = SolrCellService::class;
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"dg/bypass-finals": "^1.6",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^10.1",
"phpunit/phpunit": "^11.4",
"typo3/cms-lowlevel": "*",
"typo3/coding-standards": "v0.8.0",
"typo3/testing-framework": "^8.0"
"typo3/testing-framework": "dev-main#47bf0daab24b4210221f46a1fde59b9c3e245e39 as 9.0"
},
"suggest": {
"apache-solr-for-typo3/solr": "Allows to use Solr Cell - Apache Tika embedded in Apache Solr.",
Expand Down

0 comments on commit e38da56

Please sign in to comment.