Use MediaWikiCoversValidator for tests that don't use MediaWikiTestCase
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / SamplingStatsdClientTest.php
index 9a48930..cf18aaf 100644 (file)
@@ -1,13 +1,17 @@
 <?php
 
 use Liuggio\StatsdClient\Entity\StatsdData;
+use Liuggio\StatsdClient\Sender\SenderInterface;
 
 class SamplingStatsdClientTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider samplingDataProvider
         */
        public function testSampling( $data, $sampleRate, $seed, $expectWrite ) {
-               $sender = $this->getMock( 'Liuggio\StatsdClient\Sender\SenderInterface' );
+               $sender = $this->getMockBuilder( SenderInterface::class )->getMock();
                $sender->expects( $this->any() )->method( 'open' )->will( $this->returnValue( true ) );
                if ( $expectWrite ) {
                        $sender->expects( $this->once() )->method( 'write' )
@@ -50,7 +54,7 @@ class SamplingStatsdClientTest extends PHPUnit_Framework_TestCase {
                $nonMatching->setKey( 'oof.bar' );
                $nonMatching->setValue( 1 );
 
-               $sender = $this->getMock( 'Liuggio\StatsdClient\Sender\SenderInterface' );
+               $sender = $this->getMockBuilder( SenderInterface::class )->getMock();
                $sender->expects( $this->any() )->method( 'open' )->will( $this->returnValue( true ) );
                $sender->expects( $this->once() )->method( 'write' )->with( $this->anything(),
                        $this->equalTo( $nonMatching ) );