3
3
namespace Yoast \PHPUnitPolyfills \Tests \Polyfills ;
4
4
5
5
use PHPUnit \Framework \AssertionFailedError ;
6
+ use PHPUnit \Framework \Attributes \CoversClass ;
7
+ use PHPUnit \Framework \Attributes \DataProvider ;
6
8
use PHPUnit \Framework \TestCase ;
7
9
use PHPUnit_Framework_AssertionFailedError ;
8
10
use stdClass ;
11
+ use Yoast \PHPUnitPolyfills \Helpers \ResourceHelper ;
9
12
use Yoast \PHPUnitPolyfills \Polyfills \AssertClosedResource ;
10
13
use Yoast \PHPUnitPolyfills \Polyfills \ExpectExceptionMessageMatches ;
11
14
15
18
* @covers \Yoast\PHPUnitPolyfills\Helpers\ResourceHelper
16
19
* @covers \Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource
17
20
*/
21
+ #[CoversClass( AssertClosedResource::class )]
22
+ #[CoversClass( ResourceHelper::class )]
18
23
final class AssertClosedResourceNotResourceTest extends TestCase {
19
24
20
25
use AssertClosedResource;
@@ -30,6 +35,7 @@ final class AssertClosedResourceNotResourceTest extends TestCase {
30
35
*
31
36
* @return void
32
37
*/
38
+ #[DataProvider( 'dataNotResource ' )]
33
39
public function testAssertIsClosedResource ( $ value ) {
34
40
$ pattern = '`^Failed asserting that .+? is of type ["]?resource \(closed\)["]?`s ' ;
35
41
@@ -64,6 +70,7 @@ public function testAssertIsClosedResourceFailsWithCustomMessage() {
64
70
*
65
71
* @return void
66
72
*/
73
+ #[DataProvider( 'dataNotResource ' )]
67
74
public function testAssertIsNotClosedResource ( $ value ) {
68
75
self ::assertIsNotClosedResource ( $ value );
69
76
}
@@ -95,6 +102,7 @@ public function testAssertIsNotClosedResourceFailsWithCustomMessage() {
95
102
*
96
103
* @return void
97
104
*/
105
+ #[DataProvider( 'dataNotResource ' )]
98
106
public function testShouldClosedResourceAssertionBeSkipped ( $ value ) {
99
107
$ this ->assertFalse ( self ::shouldClosedResourceAssertionBeSkipped ( $ value ) );
100
108
}
0 commit comments