diff --git a/src/Exception/InvalidLockMode.php b/src/Exception/InvalidLockMode.php new file mode 100644 index 00000000000..9a4d6c77bc9 --- /dev/null +++ b/src/Exception/InvalidLockMode.php @@ -0,0 +1,24 @@ + 12, 'fixed' => true]], ]; } + + public function testInvalidLockMode(): void + { + $this->expectException(InvalidLockMode::class); + $this->platform->appendLockHint('TABLE', 128); + } } interface GetCreateTableSqlDispatchEventListener diff --git a/tests/Platforms/SQLServerPlatformTest.php b/tests/Platforms/SQLServerPlatformTest.php index 303a2804afd..7e6925ebf1b 100644 --- a/tests/Platforms/SQLServerPlatformTest.php +++ b/tests/Platforms/SQLServerPlatformTest.php @@ -16,7 +16,7 @@ public function createPlatform(): AbstractPlatform /** * @dataProvider getLockHints */ - public function testAppendsLockHint(?int $lockMode, string $lockHint): void + public function testAppendsLockHint(int $lockMode, string $lockHint): void { $fromClause = 'FROM users'; $expectedResult = $fromClause . $lockHint; @@ -30,7 +30,6 @@ public function testAppendsLockHint(?int $lockMode, string $lockHint): void public static function getLockHints(): iterable { return [ - [null, ''], [LockMode::NONE, ' WITH (NOLOCK)'], [LockMode::OPTIMISTIC, ''], [LockMode::PESSIMISTIC_READ, ' WITH (HOLDLOCK, ROWLOCK)'],