@@ -32,7 +32,8 @@ protected function setUp(): void
3232 public function testGenerateReturnsPrimaryApiKey (): void
3333 {
3434 $ expected = new ApiKey ('phpunit ' , 'aaaaaaaa ' , 'aaaaaaaaaaaaaaaa ' );
35- $ this ->primary ->method ('generate ' )
35+ $ this ->primary ->expects (self ::once ())
36+ ->method ('generate ' )
3637 ->willReturn ($ expected );
3738 $ this ->fallback ->expects (self ::never ())
3839 ->method ('generate ' );
@@ -44,7 +45,8 @@ public function testGenerateReturnsPrimaryApiKey(): void
4445 public function testParseParsesPrimary (): void
4546 {
4647 $ expected = new ApiKey ('phpunit ' , 'aaaaaaaa ' , 'aaaaaaaaaaaaaaaa ' );
47- $ this ->primary ->method ('parse ' )
48+ $ this ->primary ->expects (self ::once ())
49+ ->method ('parse ' )
4850 ->willReturn ($ expected );
4951 $ this ->fallback ->expects (self ::never ())
5052 ->method ('parse ' );
@@ -56,9 +58,11 @@ public function testParseParsesPrimary(): void
5658 public function testParseUsesFallback (): void
5759 {
5860 $ expected = new ApiKey ('phpunit ' , 'aaaaaaaa ' , 'aaaaaaaaaaaaaaaa ' );
59- $ this ->primary ->method ('parse ' )
61+ $ this ->primary ->expects (self ::once ())
62+ ->method ('parse ' )
6063 ->willReturn (null );
61- $ this ->fallback ->method ('parse ' )
64+ $ this ->fallback ->expects (self ::once ())
65+ ->method ('parse ' )
6266 ->willReturn ($ expected );
6367
6468 $ actual = $ this ->chain ->parse ('phpunit_aaaaaaaa_aaaaaaaaaaaaaaaa_8e3c92a2 ' );
@@ -67,9 +71,11 @@ public function testParseUsesFallback(): void
6771
6872 public function testParseReturnsNull (): void
6973 {
70- $ this ->primary ->method ('parse ' )
74+ $ this ->primary ->expects (self ::once ())
75+ ->method ('parse ' )
7176 ->willReturn (null );
72- $ this ->fallback ->method ('parse ' )
77+ $ this ->fallback ->expects (self ::once ())
78+ ->method ('parse ' )
7379 ->willReturn (null );
7480
7581 $ actual = $ this ->chain ->parse ('phpunit_aaaaaaaa_aaaaaaaaaaaaaaaa_8e3c92a2 ' );
0 commit comments