jenkins-bot has submitted this change and it was merged.

Change subject: Fix -> vs. > typo in DispatchStatsTest
......................................................................


Fix -> vs. > typo in DispatchStatsTest

I found the typo because PHPStorm complained about undeclared constants.
Looks like a lot more is broken here.

Please note that I don't fully understand what this test is supposed to
test! I tried to change it so it does succeed on my machine. Let's see
if it succeeds on Jenkins.

Change-Id: I11522d84b88811bdf3fe6aa8d315d18eb96598e9
---
M repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
1 file changed, 48 insertions(+), 35 deletions(-)

Approvals:
  Aude: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php 
b/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
index 5097fe0..de9ab86 100644
--- a/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
+++ b/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Tests\Repo;
 
+use stdClass;
 use Wikibase\DispatchStats;
 
 /**
@@ -140,7 +141,7 @@
                                                'chd_touched' => 
'20130303000110',
                                                'chd_untouched' => 170,
                                                'chd_pending' => 2,
-                                               'chd_lag' => 120,
+                                               'chd_lag' => 170,
                                        ),
                                        array(
                                                'chd_site' => 'dewiki',
@@ -148,7 +149,7 @@
                                                'chd_touched' => 
'20130303000220',
                                                'chd_untouched' => 100,
                                                'chd_pending' => 1,
-                                               'chd_lag' => 60,
+                                               'chd_lag' => 100,
                                        ),
                                        array(
                                                'chd_site' => 'enwiki',
@@ -156,7 +157,7 @@
                                                'chd_touched' => 
'20130303000330',
                                                'chd_untouched' => 30,
                                                'chd_pending' => 0,
-                                               'chd_lag' => 0,
+                                               'chd_lag' => 30,
                                        ),
                                ),
 
@@ -174,7 +175,7 @@
                                        'chd_touched' => '20130303000330',
                                        'chd_untouched' => 30,
                                        'chd_pending' => 0,
-                                       'chd_lag' => 0,
+                                       'chd_lag' => 30,
                                ),
                                'getStalest' => array(
                                        'chd_site' => 'frwiki',
@@ -182,20 +183,20 @@
                                        'chd_touched' => '20130303000110',
                                        'chd_untouched' => 170,
                                        'chd_pending' => 2,
-                                       'chd_lag' => 120,
+                                       'chd_lag' => 170,
                                ),
                                'getMedian' => array(
-                                       'chd_site' => 'dewiki',
-                                       'chd_seen' => 2,
-                                       'chd_touched' => '20130303000220',
+                                       'chd_site' => 'frwiki',
+                                       'chd_seen' => 1,
+                                       'chd_touched' => '20130303000110',
                                        'chd_untouched' => 100,
                                        'chd_pending' => 1,
-                                       'chd_lag' => 60,
+                                       'chd_lag' => 170,
                                ),
                                'getAverage' => array(
                                        'chd_untouched' => 100,
                                        'chd_pending' => 1,
-                                       'chd_lag' => 60,
+                                       'chd_lag' => 170,
                                ),
                        ),
                );
@@ -213,8 +214,9 @@
 
        /**
         * @dataProvider provideGetClientStates
+        * @param array[] $expected
         */
-       public function testGetClientStates( $expected ) {
+       public function testGetClientStates( array $expected ) {
                $stats = $this->getDispatchStats();
 
                $states = $stats->getClientStates();
@@ -229,31 +231,32 @@
                }
        }
 
-       private function assertStateEquals( $expected, $actual ) {
-               $this->assertInternalType( 'array', $expected );
-               $this->assertInternalType( 'object', $actual );
+       /**
+        * @param array $expected
+        * @param stdClass $actual
+        */
+       private function assertStateEquals( array $expected, stdClass $actual ) 
{
+               $suffix = '';
 
-               if ( isset( $expected['site'] ) ) {
-                       $this->assertEquals( $expected['site'], 
$actual>chd_site, 'site' );
-                       $suffix = "/" . $expected['site'];
-               } else {
-                       $suffix = '';
+               if ( isset( $expected['chd_site'] ) ) {
+                       $this->assertEquals( $expected['chd_site'], 
$actual->chd_site, 'site' );
+                       $suffix .= '/' . $expected['chd_site'];
                }
 
-               if ( isset( $expected['seen'] ) ) {
-                       $this->assertEquals( $expected['seen'], 
$actual>chd_seen, "seen/$suffix" );
+               if ( isset( $expected['chd_seen'] ) ) {
+                       $this->assertEquals( $expected['chd_seen'], 
$actual->chd_seen, "seen$suffix" );
                }
 
-               if ( isset( $expected['touched'] ) ) {
-                       $this->assertEquals( $expected['touched'], 
$actual>chd_touched, "touched/$suffix" );
+               if ( isset( $expected['chd_touched'] ) ) {
+                       $this->assertEquals( $expected['chd_touched'], 
$actual->chd_touched, "touched$suffix" );
                }
 
-               if ( isset( $expected['lag'] ) ) {
-                       $this->assertEquals( $expected['lag'], 
$actual>chd_untouched, "lag/$suffix" );
+               if ( isset( $expected['chd_lag'] ) ) {
+                       $this->assertEquals( $expected['chd_lag'], 
$actual->chd_untouched, "lag$suffix" );
                }
 
-               if ( isset( $expected['dist'] ) ) {
-                       $this->assertEquals( $expected['dist'], 
$actual>chd_pending, "dist/$suffix" );
+               if ( isset( $expected['chd_dist'] ) ) {
+                       $this->assertEquals( $expected['chd_dist'], 
$actual->chd_pending, "dist$suffix" );
                }
        }
 
@@ -269,6 +272,7 @@
 
        /**
         * @dataProvider provideGetClientCount
+        * @param int $expected
         */
        public function testGetClientCount( $expected ) {
                $stats = $this->getDispatchStats( );
@@ -288,6 +292,7 @@
 
        /**
         * @dataProvider provideGetLockedCount
+        * @param int $expected
         */
        public function testGetLockedCount( $expected ) {
                $stats = $this->getDispatchStats();
@@ -307,6 +312,7 @@
 
        /**
         * @dataProvider provideGetMinChangeId
+        * @param int $expected
         */
        public function testGetMinChangeId( $expected ) {
                $stats = $this->getDispatchStats();
@@ -326,6 +332,7 @@
 
        /**
         * @dataProvider provideGetMaxChangeId
+        * @param int $expected
         */
        public function testGetMaxChangeId( $expected ) {
                $stats = $this->getDispatchStats();
@@ -345,6 +352,7 @@
 
        /**
         * @dataProvider provideGetMinChangeTimestamp
+        * @param string $expected
         */
        public function testGetMinChangeTimestamp( $expected ) {
                $stats = $this->getDispatchStats();
@@ -364,6 +372,7 @@
 
        /**
         * @dataProvider provideGetMaxChangeTimestamp
+        * @param string $expected
         */
        public function testGetMaxChangeTimestamp( $expected ) {
                $stats = $this->getDispatchStats();
@@ -383,11 +392,12 @@
 
        /**
         * @dataProvider provideGetFreshest
+        * @param array $expected
         */
-       public function testGetFreshest( $expected ) {
+       public function testGetFreshest( array $expected ) {
                $stats = $this->getDispatchStats();
 
-               $this->assertStateEquals( $expected, $stats->getFreshest());
+               $this->assertStateEquals( $expected, $stats->getFreshest() );
        }
 
        public function provideGetStalest() {
@@ -402,11 +412,12 @@
 
        /**
         * @dataProvider provideGetStalest
+        * @param array $expected
         */
-       public function testGetStalest( $expected ) {
+       public function testGetStalest( array $expected ) {
                $stats = $this->getDispatchStats();
 
-               $this->assertStateEquals( $expected, $stats->getStalest());
+               $this->assertStateEquals( $expected, $stats->getStalest() );
        }
 
        public function provideGetAverage() {
@@ -421,11 +432,12 @@
 
        /**
         * @dataProvider provideGetAverage
+        * @param array $expected
         */
-       public function testGetAverage( $expected ) {
+       public function testGetAverage( array $expected ) {
                $stats = $this->getDispatchStats();
 
-               $this->assertStateEquals( $expected, $stats->getStalest());
+               $this->assertStateEquals( $expected, $stats->getStalest() );
        }
 
        public function provideGetMedian() {
@@ -440,11 +452,12 @@
 
        /**
         * @dataProvider provideGetMedian
+        * @param array $expected
         */
-       public function testGetMedian( $expected ) {
+       public function testGetMedian( array $expected ) {
                $stats = $this->getDispatchStats();
 
-               $this->assertStateEquals( $expected, $stats->getStalest());
+               $this->assertStateEquals( $expected, $stats->getStalest() );
        }
 
        public function testHasStats() {

-- 
To view, visit https://gerrit.wikimedia.org/r/188341
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I11522d84b88811bdf3fe6aa8d315d18eb96598e9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to