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(
42
42
public static function fromKeyValue (
43
43
string $ key ,
44
44
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 ,
56
45
): self {
57
46
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 " ,
61
50
);
62
51
}
63
52
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ public function testItCannotAcquireLockWithinTransactionNotInTransaction(): void
467
467
{
468
468
$ this ->expectException (LogicException::class);
469
469
$ 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 ' ,
471
471
);
472
472
473
473
$ locker = $ this ->initLocker ();
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 13
13
14
14
namespace Cog \Test \DbLocker \Unit \LockId ;
15
15
16
- use Cog \DbLocker \LockId \LockId ;
17
16
use Cog \DbLocker \LockId \PostgresLockId ;
18
17
use Cog \Test \DbLocker \Unit \AbstractUnitTestCase ;
19
18
use PHPUnit \Framework \Attributes \DataProvider ;
@@ -54,34 +53,6 @@ public static function provideItCanCreatePostgresLockIdFromKeyValueData(): array
54
53
];
55
54
}
56
55
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
-
85
56
#[DataProvider('provideItCanCreatePostgresLockIdFromIntKeysData ' )]
86
57
public function testItCanCreatePostgresLockIdFromIntKeys (
87
58
int $ classId ,
You can’t perform that action at this time.
0 commit comments