From 17c924b3ea624d62e9d65fed38608a4f912a7705 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Thu, 16 Nov 2023 14:41:10 +0700 Subject: [PATCH] Add test for count greater than `PHP_INT_MAX` --- tests/AbstractQueryTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/AbstractQueryTest.php b/tests/AbstractQueryTest.php index 63334ea9a..754cab5a3 100644 --- a/tests/AbstractQueryTest.php +++ b/tests/AbstractQueryTest.php @@ -787,4 +787,18 @@ public function testNormalizeSelect(array|string|Expression $columns, array|stri $query->select($columns); $this->assertEquals($expected, $query->getSelect()); } + + public function testCountGreaterThanPhpIntMax(): void + { + $query = $this->getMockBuilder(Query::class) + ->setConstructorArgs([$this->getConnection()]) + ->onlyMethods(['queryScalar']) + ->getMock(); + + $query->expects($this->once()) + ->method('queryScalar') + ->willReturn('12345678901234567890'); + + $this->assertSame('12345678901234567890', $query->count()); + } }