Merge "Fix SamplingStatsdClient for PHP 7.1+"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 5 Apr 2018 18:10:06 +0000 (18:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Apr 2018 18:10:06 +0000 (18:10 +0000)
tests/phpunit/includes/libs/SamplingStatsdClientTest.php

index 85b8c62..7bd1611 100644 (file)
@@ -22,7 +22,11 @@ class SamplingStatsdClientTest extends PHPUnit\Framework\TestCase {
                } else {
                        $sender->expects( $this->never() )->method( 'write' );
                }
-               mt_srand( $seed );
+               if ( defined( 'MT_RAND_PHP' ) ) {
+                       mt_srand( $seed, MT_RAND_PHP );
+               } else {
+                       mt_srand( $seed );
+               }
                $client = new SamplingStatsdClient( $sender );
                $client->send( $data, $sampleRate );
        }