Fix WikiPageDbTestBase::testNewFromId_returnsNullOnNonExistingId
authorBrad Jorsch <bjorsch@wikimedia.org>
Sun, 18 Mar 2018 02:02:13 +0000 (22:02 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sun, 18 Mar 2018 02:02:13 +0000 (22:02 -0400)
This test is passing an "integer" that is beyond what even 64-bit PHP
can properly represent as an integer, so it likely winds up passing it
as '7.3574757437438E+19' to the database. MySQL, being MySQL, doesn't
care much, but other DBs do.

Change it to 2**31-1 instead.

Change-Id: Ieba51f034eaa1c3eabb2ada6b1ce876beefd3bff

tests/phpunit/includes/page/WikiPageDbTestBase.php

index 6367a0f..53b659f 100644 (file)
@@ -1390,7 +1390,7 @@ more stuff
         * @covers WikiPage::newFromID
         */
        public function testNewFromId_returnsNullOnNonExistingId() {
-               $this->assertNull( WikiPage::newFromID( 73574757437437743743 ) );
+               $this->assertNull( WikiPage::newFromID( 2147483647 ) );
        }
 
        public function provideTestInsertProtectNullRevision() {