Skip to content

Commit a2b1d4b

Browse files
committed
Update PHPUnit 10
1 parent daaebc8 commit a2b1d4b

File tree

6 files changed

+25
-18
lines changed

6 files changed

+25
-18
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ vagrant/Homestead/
5454

5555
# Ignore dev utility cache
5656
.phpunit.result.cache
57+
.phpunit.cache
5758
.php_cs.cache
5859

5960
# Ignore api doc

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [5.0.1](https://github.com/lcharette/UF_FormGenerator/compare/5.0.1...6.0.0)
44
- Require UserFrosting 5.1
5+
- Update PHPUnit 10
56

67
## [5.0.1](https://github.com/lcharette/UF_FormGenerator/compare/5.0.0...5.0.1)
78
- Update PHP & JS dependencies

app/tests/ElementTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testElement(string $elementName, string $class, $value, array $e
6666
*
6767
* @return mixed[]
6868
*/
69-
public function elementsProvider(): array
69+
public static function elementsProvider(): array
7070
{
7171
return [
7272
// TEXT - With Null value

app/tests/FormTest.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ public function testForm(string $file, $data, array $expected): void
7171
*
7272
* @return mixed[]
7373
*/
74-
public function formProvider(): array
74+
public static function formProvider(): array
7575
{
76-
$stub = $this->createMock(Model::class);
77-
$stub->method('toArray')->willReturn(['name' => 'Bar project']);
78-
7976
return [
8077
// WITH NO DATA
8178
[
@@ -244,7 +241,7 @@ public function formProvider(): array
244241
// WITH DATA AS MODEL
245242
[
246243
'/good.json',
247-
$stub,
244+
new MockModel(),
248245
[
249246
'name' => [
250247
'autocomplete' => 'off',
@@ -681,3 +678,12 @@ protected function applyTransformations(): void
681678
], $this->element);
682679
}
683680
}
681+
682+
class MockModel extends Model
683+
{
684+
/** @return array<string, string> */
685+
public function toArray()
686+
{
687+
return ['name' => 'Bar project'];
688+
}
689+
}

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"phpstan/phpstan-deprecation-rules": "^1.0",
2323
"phpstan/phpstan-phpunit": "^1.0",
2424
"phpstan/phpstan-strict-rules": "^1.0",
25-
"phpunit/phpunit": "^9.5",
25+
"phpunit/phpunit": "^10.5",
2626
"fakerphp/faker": "^1.17",
2727
"slam/phpstan-extensions": "^6.0",
2828
"userfrosting/theme-adminlte": "^5.0"

phpunit.xml

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
backupGlobals="false"
4-
backupStaticAttributes="false"
54
bootstrap="vendor/autoload.php"
65
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
106
processIsolation="false"
117
stderr="true"
128
stopOnFailure="false"
13-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
14-
>
15-
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
16-
<include>
17-
<directory suffix=".php">app/src/</directory>
18-
<directory suffix=".php">public/src/</directory>
19-
</include>
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
11+
backupStaticProperties="false">
12+
<coverage includeUncoveredFiles="true">
2013
<report>
2114
<clover outputFile="_meta/coverage.xml"/>
2215
<html outputDirectory="_meta/coverage"/>
@@ -31,4 +24,10 @@
3124
<php>
3225
<env name="UF_MODE" value="testing"/>
3326
</php>
27+
<source>
28+
<include>
29+
<directory suffix=".php">app/src/</directory>
30+
<directory suffix=".php">public/src/</directory>
31+
</include>
32+
</source>
3433
</phpunit>

0 commit comments

Comments
 (0)