File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 23
23
"require" : {
24
24
"php" : " >=5.6" ,
25
25
"php-mock/php-mock" : " ^2.5" ,
26
- "phpunit/php-text-template" : " ^1 || ^2 || ^3 || ^4"
26
+ "phpunit/php-text-template" : " ^1 || ^2 || ^3 || ^4 || ^5 "
27
27
},
28
28
"require-dev" : {
29
- "phpunit/phpunit" : " ^5.7.27 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11"
29
+ "phpunit/phpunit" : " ^5.7.27 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 "
30
30
},
31
31
"archive" : {
32
32
"exclude" : [" /tests" ]
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ public function testSameSignaturesProduceSameClass()
71
71
*
72
72
* @doesNotPerformAssertions
73
73
*/
74
+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
75
+ #[\PHPUnit \Framework \Attributes \DataProvider('provideTestBackupStaticAttributes ' )]
76
+ #[\PHPUnit \Framework \Attributes \BackupStaticProperties(true )]
74
77
public function testBackupStaticAttributes ()
75
78
{
76
79
$ builder = new MockDelegateFunctionBuilder ();
@@ -97,12 +100,14 @@ public static function provideTestBackupStaticAttributes()
97
100
*
98
101
* @doesNotPerformAssertions
99
102
*/
103
+ #[\PHPUnit \Framework \Attributes \RunInSeparateProcess]
104
+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
100
105
public function testDeserializationInNewProcess ()
101
106
{
102
107
$ builder = new MockDelegateFunctionBuilder ();
103
108
$ builder ->build ("min " );
104
109
105
- $ data = serialize ($ this ->getMockForAbstractClass ($ builder ->getFullyQualifiedClassName ()));
110
+ $ data = serialize ($ this ->getMockBuilder ($ builder ->getFullyQualifiedClassName ())-> getMock ( ));
106
111
107
112
unserialize ($ data );
108
113
}
Original file line number Diff line number Diff line change @@ -35,10 +35,13 @@ protected function setUpCompat()
35
35
*
36
36
* @test
37
37
*/
38
+ #[\PHPUnit \Framework \Attributes \Test]
38
39
public function testDelegateReturnsMockResult ()
39
40
{
40
41
$ expected = 3 ;
41
- $ mock = $ this ->getMockForAbstractClass ($ this ->className );
42
+ $ mock = $ this ->getMockBuilder ($ this ->className )
43
+ ->onlyMethods ([MockDelegateFunctionBuilder::METHOD ])
44
+ ->getMock ();
42
45
43
46
$ mock ->expects ($ this ->once ())
44
47
->method (MockDelegateFunctionBuilder::METHOD )
@@ -53,14 +56,17 @@ public function testDelegateReturnsMockResult()
53
56
*
54
57
* @test
55
58
*/
59
+ #[\PHPUnit \Framework \Attributes \Test]
56
60
public function testDelegateForwardsArguments ()
57
61
{
58
- $ mock = $ this ->getMockForAbstractClass ($ this ->className );
59
-
62
+ $ mock = $ this ->getMockBuilder ($ this ->className )
63
+ ->onlyMethods ([MockDelegateFunctionBuilder::METHOD ])
64
+ ->getMock ();
65
+
60
66
$ mock ->expects ($ this ->once ())
61
67
->method (MockDelegateFunctionBuilder::METHOD )
62
68
->with (1 , 2 );
63
-
69
+
64
70
call_user_func ($ mock ->getCallable (), 1 , 2 );
65
71
}
66
72
}
You can’t perform that action at this time.
0 commit comments