Add per-partition JobQueueRedis aggregation
[lhc/web/wiklou.git] / tests / phpunit / includes / jobqueue / JobQueueTest.php
index 3cb1af6..bb74e95 100644 (file)
@@ -332,6 +332,25 @@ class JobQueueTest extends MediaWikiTestCase {
                $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" );
        }
 
+       /**
+        * @covers JobQueue
+        */
+       public function testQueueAggregateTable() {
+               $queue = $this->queueFifo;
+               if ( !$queue || !method_exists( $queue, 'getServerQueuesWithJobs' ) ) {
+                       $this->markTestSkipped();
+               }
+
+               $this->assertArrayEquals( array(), $queue->getServerQueuesWithJobs() );
+
+               $queue->push( $this->newJob( 0 ) );
+
+               $this->assertArrayEquals(
+                       array( array( $queue->getType(), $queue->getWiki() ) ),
+                       $queue->getServerQueuesWithJobs()
+               );
+       }
+
        public static function provider_queueLists() {
                return array(
                        array( 'queueRand', false, 'Random queue without ack()' ),