File tree Expand file tree Collapse file tree 4 files changed +4
-112
lines changed Expand file tree Collapse file tree 4 files changed +4
-112
lines changed Original file line number Diff line number Diff line change @@ -42,22 +42,11 @@ private function __construct(
4242 public static function fromKeyValue (
4343 string $ key ,
4444 string $ value = '' ,
45- ): self {
46- return self ::fromLockId (
47- new LockId (
48- $ key ,
49- $ value ,
50- ),
51- );
52- }
53-
54- public static function fromLockId (
55- LockId $ lockId ,
5645 ): self {
5746 return new self (
58- classId: self ::convertStringToSignedInt32 ($ lockId -> key ),
59- objectId: self ::convertStringToSignedInt32 ($ lockId -> value ),
60- humanReadableValue: ( string ) $ lockId ,
47+ classId: self ::convertStringToSignedInt32 ($ key ),
48+ objectId: self ::convertStringToSignedInt32 ($ value ),
49+ humanReadableValue: " $ key : $ value " ,
6150 );
6251 }
6352
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ public function testItCannotAcquireLockWithinTransactionNotInTransaction(): void
467467 {
468468 $ this ->expectException (LogicException::class);
469469 $ this ->expectExceptionMessage (
470- 'Transaction-level advisory lock `test` cannot be acquired outside of transaction ' ,
470+ 'Transaction-level advisory lock `test: ` cannot be acquired outside of transaction ' ,
471471 );
472472
473473 $ locker = $ this ->initLocker ();
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1313
1414namespace Cog \Test \DbLocker \Unit \LockId ;
1515
16- use Cog \DbLocker \LockId \LockId ;
1716use Cog \DbLocker \LockId \PostgresLockId ;
1817use Cog \Test \DbLocker \Unit \AbstractUnitTestCase ;
1918use PHPUnit \Framework \Attributes \DataProvider ;
@@ -54,34 +53,6 @@ public static function provideItCanCreatePostgresLockIdFromKeyValueData(): array
5453 ];
5554 }
5655
57- #[DataProvider('provideItCanCreatePostgresLockIdFromLockIdData ' )]
58- public function testItCanCreatePostgresLockIdFromLockId (
59- LockId $ lockId ,
60- int $ expectedClassId ,
61- int $ expectedObjectId ,
62- ): void {
63- $ postgresLockId = PostgresLockId::fromLockId ($ lockId );
64-
65- $ this ->assertSame ($ expectedClassId , $ postgresLockId ->classId );
66- $ this ->assertSame ($ expectedObjectId , $ postgresLockId ->objectId );
67- }
68-
69- public static function provideItCanCreatePostgresLockIdFromLockIdData (): array
70- {
71- return [
72- 'key only ' => [
73- new LockId ('test ' ),
74- -662733300 ,
75- 0 ,
76- ],
77- 'key + value ' => [
78- new LockId ('test ' , '1 ' ),
79- -662733300 ,
80- -2082672713 ,
81- ],
82- ];
83- }
84-
8556 #[DataProvider('provideItCanCreatePostgresLockIdFromIntKeysData ' )]
8657 public function testItCanCreatePostgresLockIdFromIntKeys (
8758 int $ classId ,
You can’t perform that action at this time.
0 commit comments