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 2323 "require" : {
2424 "php" : " >=5.6" ,
2525 "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 "
2727 },
2828 "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 "
3030 },
3131 "archive" : {
3232 "exclude" : [" /tests" ]
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ public function testSameSignaturesProduceSameClass()
7171 *
7272 * @doesNotPerformAssertions
7373 */
74+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
75+ #[\PHPUnit \Framework \Attributes \DataProvider('provideTestBackupStaticAttributes ' )]
76+ #[\PHPUnit \Framework \Attributes \BackupStaticProperties(true )]
7477 public function testBackupStaticAttributes ()
7578 {
7679 $ builder = new MockDelegateFunctionBuilder ();
@@ -97,12 +100,14 @@ public static function provideTestBackupStaticAttributes()
97100 *
98101 * @doesNotPerformAssertions
99102 */
103+ #[\PHPUnit \Framework \Attributes \RunInSeparateProcess]
104+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
100105 public function testDeserializationInNewProcess ()
101106 {
102107 $ builder = new MockDelegateFunctionBuilder ();
103108 $ builder ->build ("min " );
104109
105- $ data = serialize ($ this ->getMockForAbstractClass ($ builder ->getFullyQualifiedClassName ()));
110+ $ data = serialize ($ this ->getMockBuilder ($ builder ->getFullyQualifiedClassName ())-> getMock ( ));
106111
107112 unserialize ($ data );
108113 }
Original file line number Diff line number Diff line change @@ -35,10 +35,13 @@ protected function setUpCompat()
3535 *
3636 * @test
3737 */
38+ #[\PHPUnit \Framework \Attributes \Test]
3839 public function testDelegateReturnsMockResult ()
3940 {
4041 $ expected = 3 ;
41- $ mock = $ this ->getMockForAbstractClass ($ this ->className );
42+ $ mock = $ this ->getMockBuilder ($ this ->className )
43+ ->onlyMethods ([MockDelegateFunctionBuilder::METHOD ])
44+ ->getMock ();
4245
4346 $ mock ->expects ($ this ->once ())
4447 ->method (MockDelegateFunctionBuilder::METHOD )
@@ -53,14 +56,17 @@ public function testDelegateReturnsMockResult()
5356 *
5457 * @test
5558 */
59+ #[\PHPUnit \Framework \Attributes \Test]
5660 public function testDelegateForwardsArguments ()
5761 {
58- $ mock = $ this ->getMockForAbstractClass ($ this ->className );
59-
62+ $ mock = $ this ->getMockBuilder ($ this ->className )
63+ ->onlyMethods ([MockDelegateFunctionBuilder::METHOD ])
64+ ->getMock ();
65+
6066 $ mock ->expects ($ this ->once ())
6167 ->method (MockDelegateFunctionBuilder::METHOD )
6268 ->with (1 , 2 );
63-
69+
6470 call_user_func ($ mock ->getCallable (), 1 , 2 );
6571 }
6672}
You can’t perform that action at this time.
0 commit comments