Skip to content

Commit 1e95b15

Browse files
author
Ante Prkacin
committed
NGSTACK-995 update PHPUnit to version 12, migrate 'phpunit.xml' file to a newer version and fix some tests
1 parent dcf91f9 commit 1e95b15

File tree

4 files changed

+21
-29
lines changed

4 files changed

+21
-29
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"twig/twig": "^3.0"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "^9.0",
24+
"phpunit/phpunit": "^12.0",
2525
"netgen/ibexa-forms-bundle": "^5.0",
2626
"friendsofphp/php-cs-fixer": "^3.3",
2727
"ibexa/solr": "^5.0"

phpunit.xml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,25 @@
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
bootstrap="vendor/autoload.php"
44
backupGlobals="false"
5-
backupStaticAttributes="false"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
95
colors="true"
10-
verbose="true"
116
processIsolation="false"
127
stopOnFailure="false"
138
beStrictAboutTestsThatDoNotTestAnything="false"
14-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
15-
<coverage>
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.4/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
11+
backupStaticProperties="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Netgen\EnhancedSelectionBundle\Tests">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
19+
<logging>
20+
<junit outputFile="build/report.junit.xml"/>
21+
</logging>
22+
23+
<source>
1624
<include>
1725
<directory suffix=".php">bundle</directory>
1826
</include>
@@ -24,18 +32,5 @@
2432
<file>bundle/Core/FieldType/EnhancedSelection/SearchField.php</file>
2533
<file>bundle/NetgenEnhancedSelectionBundle.php</file>
2634
</exclude>
27-
<report>
28-
<clover outputFile="build/logs/clover.xml"/>
29-
<html outputDirectory="build/coverage"/>
30-
<text outputFile="build/coverage.txt"/>
31-
</report>
32-
</coverage>
33-
<testsuites>
34-
<testsuite name="Netgen\EnhancedSelectionBundle\Tests">
35-
<directory>tests</directory>
36-
</testsuite>
37-
</testsuites>
38-
<logging>
39-
<junit outputFile="build/report.junit.xml"/>
40-
</logging>
35+
</source>
4136
</phpunit>

tests/Core/FieldType/EnhancedSelection/EnhancedSelectionStorageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testStoreFieldData(): void
6060
]
6161
);
6262

63-
$connection = $this->getMockForAbstractClass(StorageGateway::class);
63+
$connection = $this->createMock(StorageGateway::class);
6464
$context = ['identifier' => 'enhancedselection', 'connection' => $connection];
6565

6666
$this->gateway->expects(self::once())
@@ -86,7 +86,7 @@ public function testGetFieldData(): void
8686
]
8787
);
8888

89-
$connection = $this->getMockForAbstractClass(StorageGateway::class);
89+
$connection = $this->createMock(StorageGateway::class);
9090
$context = ['identifier' => 'enhancedselection', 'connection' => $connection];
9191

9292
$this->gateway->expects(self::once())
@@ -100,7 +100,7 @@ public function testDeleteFieldData(): void
100100
$versionInfo = new VersionInfo();
101101
$fields = ['some_field'];
102102

103-
$connection = $this->getMockForAbstractClass(StorageGateway::class);
103+
$connection = $this->createMock(StorageGateway::class);
104104
$context = ['identifier' => 'enhancedselection', 'connection' => $connection];
105105

106106
$this->gateway->expects(self::once())

tests/Templating/Twig/NetgenEnhancedSelectionRuntimeTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ final class NetgenEnhancedSelectionRuntimeTest extends TestCase
2525

2626
protected function setUp(): void
2727
{
28-
$this->contentTypeService = $this->getMockBuilder(ContentTypeService::class)
29-
->disableOriginalConstructor()
30-
->onlyMethods(['loadContentType'])
31-
->getMockForAbstractClass();
28+
$this->contentTypeService = $this->createMock(ContentTypeService::class);
3229

3330
$this->runtime = new NetgenEnhancedSelectionRuntime($this->contentTypeService);
3431
}

0 commit comments

Comments
 (0)