X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsite%2FSiteExporterTest.php;h=09cdea7a08c7528fb570a0b0ac9c455502ea5af4;hp=19dd0aa12c0d318fbaf6ef8e743c2eb1c57129c5;hb=827c6bfa416d9d0de8cc8e22f9f3fa36d8129d44;hpb=39508404aa6e7d9e8ce55eeeab523bf31e8affb6 diff --git a/tests/phpunit/includes/site/SiteExporterTest.php b/tests/phpunit/includes/site/SiteExporterTest.php index 19dd0aa12c..09cdea7a08 100644 --- a/tests/phpunit/includes/site/SiteExporterTest.php +++ b/tests/phpunit/includes/site/SiteExporterTest.php @@ -31,6 +31,8 @@ */ class SiteExporterTest extends PHPUnit_Framework_TestCase { + use MediaWikiCoversValidator; + public function testConstructor_InvalidArgument() { $this->setExpectedException( 'InvalidArgumentException' ); @@ -50,10 +52,10 @@ class SiteExporterTest extends PHPUnit_Framework_TestCase { $tmp = tmpfile(); $exporter = new SiteExporter( $tmp ); - $exporter->exportSites( array( $foo, $acme ) ); + $exporter->exportSites( [ $foo, $acme ] ); fseek( $tmp, 0 ); - $xml = fread( $tmp, 16*1024 ); + $xml = fread( $tmp, 16 * 1024 ); $this->assertContains( 'assertContains( '', $xml ); @@ -75,7 +77,7 @@ class SiteExporterTest extends PHPUnit_Framework_TestCase { } private function newSiteStore( SiteList $sites ) { - $store = $this->getMock( 'SiteStore' ); + $store = $this->getMockBuilder( 'SiteStore' )->getMock(); $store->expects( $this->once() ) ->method( 'saveSites' ) @@ -112,15 +114,15 @@ class SiteExporterTest extends PHPUnit_Framework_TestCase { $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' ); $dewiki->setSource( 'meta.wikimedia.org' ); - return array( - 'empty' => array( + return [ + 'empty' => [ new SiteList() - ), + ], - 'some' => array( - new SiteList( array( $foo, $acme, $dewiki ) ), - ), - ); + 'some' => [ + new SiteList( [ $foo, $acme, $dewiki ] ), + ], + ]; } /** @@ -133,7 +135,7 @@ class SiteExporterTest extends PHPUnit_Framework_TestCase { $exporter->exportSites( $sites ); fseek( $tmp, 0 ); - $xml = fread( $tmp, 16*1024 ); + $xml = fread( $tmp, 16 * 1024 ); $actualSites = new SiteList(); $store = $this->newSiteStore( $actualSites );