Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,26 @@ jobs:
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5
phpunit:
- 10
- 11
- 12
- 13
exclude:
- php: 8.1
phpunit: 11
- php: 8.1
phpunit: 12
- php: 8.1
phpunit: 13
- php: 8.2
phpunit: 12
- php: 8.2
phpunit: 13
- php: 8.3
phpunit: 13

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"require": {
"php": ">=8.1",
"phpunit/phpunit": "^10.5.28|^11.2.8"
"phpunit/phpunit": "^10.5.28|^11.2.8|^12|^13"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions test/CapabilitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public function testMixedSeverities(): void
}

#[DataProvider('provideData')]

public function testDataProvider(): void
public function testDataProvider(string $data): void
{
self::assertTrue(true);
}
Expand Down
4 changes: 2 additions & 2 deletions test/config/test dp args.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ PHPUnit %s
Runtime: %s
Configuration: %s

50% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set "foo" (%d ms)
100% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set #0 (%d ms)
50% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider%swith data%s (%d ms)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests should be as precise as possible. This is very lax, having now completely omitted the data set names.

  1. Why is the first %s needed?
  2. Why were data set names replaced with the second %s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using phpunit 10/11 the data set and data is detailed always after the test: "with data set '@name or data set'|'#index of dataset' and then the ('data used'), but from Phpunit 12, the dataset is specified just after the test name: testDataProvider@foo|testDataProvider#0 with data ('data'), so, if I wanted to support both I tried by using EXPECTREGEX, but I can't found a way to have it working

100% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider%swith data%s (%d ms)


Time: %s
Expand Down
4 changes: 2 additions & 2 deletions test/functional/data provider.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ PHPUnit %s
Runtime: %s
Configuration: %s

50% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set "foo" ('bar') (%d ms)
100% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set #0 ('baz') (%d ms)
50% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider%swith data%s('bar') (%d ms)
100% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider%swith data%s('baz') (%d ms)


Time: %s
Expand Down
10 changes: 5 additions & 5 deletions test/functional/success after failure.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ PHPUnit %s
Runtime: %s
Configuration: %s

25% . ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure with data set #0 (true) (%d ms)
50% F ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure with data set #1 (false) (%d ms)
25% . ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure%swith data%s(true) (%d ms)
50% F ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure%swith data%s(false) (%d ms)

Failed asserting that false is true.

%s%eCapabilitiesTest.php:%d

75% ! ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure with data set #2 (true) (%d ms)
100% ! ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure with data set #3 (true) (%d ms)
75% ! ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure%swith data%s(true) (%d ms)
100% ! ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure%swith data%s(true) (%d ms)


Time: %s

There was 1 failure:

1) ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure with data set #1 (false)
1) ScriptFUSIONTest\Pip\CapabilitiesTest::testSuccessAfterFailure%swith data%s(false)
Failed asserting that false is true.

%s%eCapabilitiesTest.php:%d
Expand Down