wiki.techinc.nl/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php
Thiemo Mättig 1910da184e Do not return null reference in JobQueueMemory
See Ia5b7a96 and the unrelated error raised there.
https://integration.wikimedia.org/ci/job/mwext-testextension-zend/19682/consoleFull

By writing this simple test I not only found one but two issues.

Bug: T123539
Change-Id: I17ed5b69992aa98ab2384b7a6aafc96b0fcba1ce
2016-01-14 19:19:55 +01:00

30 lines
571 B
PHP

<?php
/**
* @covers JobQueueMemory
*
* @group JobQueue
*
* @licence GNU GPL v2+
* @author Thiemo Mättig
*/
class JobQueueMemoryTest extends PHPUnit_Framework_TestCase {
public function testGetAllQueuedJobs() {
$instance = JobQueueMemoryDouble::newInstance( array(
'wiki' => null,
'type' => null,
) );
$actual = $instance->getAllQueuedJobs();
$this->assertEquals( new ArrayIterator(), $actual );
}
}
class JobQueueMemoryDouble extends JobQueueMemory {
public static function newInstance( array $params ) {
return new self( $params );
}
}