@@ -24,7 +24,7 @@ protected function setUp(): void
2424
2525 $ this ->pdo = $ this ->createMock (\PDO ::class);
2626
27- $ this ->mutex = new PgAdvisoryLockMutex ($ this ->pdo , 'test ' . uniqid () );
27+ $ this ->mutex = new PgAdvisoryLockMutex ($ this ->pdo , 'test ' );
2828 }
2929
3030 private function isPhpunit9x (): bool
@@ -43,23 +43,21 @@ public function testAcquireLock(): void
4343
4444 $ statement ->expects (self ::once ())
4545 ->method ('execute ' )
46- ->with (
47- self ::logicalAnd (
48- new IsType (IsType::TYPE_ARRAY ),
49- self ::countOf (2 ),
50- self ::callback (function (...$ arguments ): bool {
51- if ($ this ->isPhpunit9x ()) { // https://github.com/sebastianbergmann/phpunit/issues/5891
52- $ arguments = $ arguments [0 ];
53- }
54-
55- foreach ($ arguments as $ v ) {
56- self ::assertIsInt ($ v );
57- }
58-
59- return true ;
60- })
61- )
62- );
46+ ->with (self ::logicalAnd (
47+ new IsType (IsType::TYPE_ARRAY ),
48+ self ::countOf (2 ),
49+ self ::callback (function (...$ arguments ): bool {
50+ if ($ this ->isPhpunit9x ()) { // https://github.com/sebastianbergmann/phpunit/issues/5891
51+ $ arguments = $ arguments [0 ];
52+ }
53+
54+ foreach ($ arguments as $ v ) {
55+ self ::assertIsInt ($ v );
56+ }
57+
58+ return true ;
59+ })
60+ ));
6361
6462 \Closure::bind (static fn ($ mutex ) => $ mutex ->lock (), null , PgAdvisoryLockMutex::class)($ this ->mutex );
6563 }
@@ -75,25 +73,23 @@ public function testReleaseLock(): void
7573
7674 $ statement ->expects (self ::once ())
7775 ->method ('execute ' )
78- ->with (
79- self ::logicalAnd (
80- new IsType (IsType::TYPE_ARRAY ),
81- self ::countOf (2 ),
82- self ::callback (function (...$ arguments ): bool {
83- if ($ this ->isPhpunit9x ()) { // https://github.com/sebastianbergmann/phpunit/issues/5891
84- $ arguments = $ arguments [0 ];
85- }
86-
87- foreach ($ arguments as $ v ) {
88- self ::assertLessThan (1 << 32 , $ v );
89- self ::assertGreaterThan (-(1 << 32 ), $ v );
90- self ::assertIsInt ($ v );
91- }
92-
93- return true ;
94- })
95- )
96- );
76+ ->with (self ::logicalAnd (
77+ new IsType (IsType::TYPE_ARRAY ),
78+ self ::countOf (2 ),
79+ self ::callback (function (...$ arguments ): bool {
80+ if ($ this ->isPhpunit9x ()) { // https://github.com/sebastianbergmann/phpunit/issues/5891
81+ $ arguments = $ arguments [0 ];
82+ }
83+
84+ foreach ($ arguments as $ v ) {
85+ self ::assertLessThan (1 << 32 , $ v );
86+ self ::assertGreaterThan (-(1 << 32 ), $ v );
87+ self ::assertIsInt ($ v );
88+ }
89+
90+ return true ;
91+ })
92+ ));
9793
9894 \Closure::bind (static fn ($ mutex ) => $ mutex ->unlock (), null , PgAdvisoryLockMutex::class)($ this ->mutex );
9995 }
0 commit comments