*
* @author Daniel Kinzler
*/
-class SiteImporterTest extends PHPUnit_Framework_TestCase {
+class SiteImporterTest extends PHPUnit\Framework\TestCase {
+
+ use MediaWikiCoversValidator;
+ use PHPUnit4And6Compat;
private function newSiteImporter( array $expectedSites, $errorCount ) {
- $store = $this->getMockBuilder( 'SiteStore' )->getMock();
+ $store = $this->getMockBuilder( SiteStore::class )->getMock();
$store->expects( $this->once() )
->method( 'saveSites' )
->method( 'getSites' )
->will( $this->returnValue( new SiteList() ) );
- $errorHandler = $this->getMockBuilder( 'Psr\Log\LoggerInterface' )->getMock();
+ $errorHandler = $this->getMockBuilder( Psr\Log\LoggerInterface::class )->getMock();
$errorHandler->expects( $this->exactly( $errorCount ) )
->method( 'error' );
}
public function testImportFromXML_malformed() {
- $this->setExpectedException( 'Exception' );
+ $this->setExpectedException( Exception::class );
- $store = $this->getMockBuilder( 'SiteStore' )->getMock();
+ $store = $this->getMockBuilder( SiteStore::class )->getMock();
$importer = new SiteImporter( $store );
$importer->importFromXML( 'THIS IS NOT XML' );
}