66
77use Clegginabox \Airlock \Bridge \Symfony \Seal \SymfonySemaphoreSeal ;
88use Clegginabox \Airlock \Exception \LeaseExpiredException ;
9- use Clegginabox \Airlock \Exception \SealAcquiringException ;
109use Clegginabox \Airlock \Tests \Factory \RedisFactory ;
1110use PHPUnit \Framework \TestCase ;
1211use Redis ;
@@ -48,9 +47,9 @@ public function testItRespectsCapacityLimit(): void
4847 $ token2 = $ this ->constraint ->tryAcquire ();
4948 $ this ->assertNotNull ($ token2 , 'Should acquire 2nd slot ' );
5049
51- // 3. Try third slot -> Should FAIL (throw SealAcquiringException )
52- $ this ->expectException (SealAcquiringException::class );
53- $ this ->constraint -> tryAcquire ( );
50+ // 3. Try third slot -> Should FAIL (returns null )
51+ $ token3 = $ this ->constraint -> tryAcquire ( );
52+ $ this ->assertNull ( $ token3 , ' Should not acquire 3rd slot ' );
5453 }
5554
5655 public function testReleaseOpensSlot (): void
@@ -60,8 +59,8 @@ public function testReleaseOpensSlot(): void
6059 $ this ->constraint ->tryAcquire ();
6160
6261 // Verify full
63- $ this ->expectException (SealAcquiringException::class );
64- $ this ->constraint -> tryAcquire ( );
62+ $ token2 = $ this ->constraint -> tryAcquire ( );
63+ $ this ->assertNull ( $ token2 );
6564
6665 // Release one
6766 $ this ->constraint ->release ($ token1 );
0 commit comments