Thiemo Mättig (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/274406
Change subject: Tests do not need to be MediaWikiTestCases
......................................................................
Tests do not need to be MediaWikiTestCases
These tests neither use the database nor need the functionality
provided by the extended class.
Change-Id: I71cdcd7c1b16b06f74014018155e5806abab71c0
---
M tests/phpunit/Html/HtmlTableBuilderTest.php
M tests/phpunit/Html/HtmlTableCellBuilderTest.php
M tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
3 files changed, 23 insertions(+), 13 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuality
refs/changes/06/274406/1
diff --git a/tests/phpunit/Html/HtmlTableBuilderTest.php
b/tests/phpunit/Html/HtmlTableBuilderTest.php
index b35d480..47bc634 100644
--- a/tests/phpunit/Html/HtmlTableBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableBuilderTest.php
@@ -2,10 +2,10 @@
namespace WikibaseQuality\ExternalValidation\Tests\Html;
+use PHPUnit_Framework_TestCase;
use WikibaseQuality\Html\HtmlTableBuilder;
use WikibaseQuality\Html\HtmlTableCellBuilder;
use WikibaseQuality\Html\HtmlTableHeaderBuilder;
-
/**
* @covers WikibaseQuality\Html\HtmlTableBuilder
@@ -18,16 +18,21 @@
* @author BP2014N1
* @license GNU GPL v2+
*/
-class HtmlTableBuilderTest extends \MediaWikiTestCase {
+class HtmlTableBuilderTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider constructDataProvider
*/
- public function testConstruct( $headers, $expectedHeaders,
$expectedIsSortable, $expectedException ) {
+ public function testConstruct(
+ $headers,
+ array $expectedHeaders = null,
+ $expectedIsSortable,
+ $expectedException
+ ) {
$this->setExpectedException( $expectedException );
$htmlTable = new HtmlTableBuilder( $headers );
- $this->assertArrayEquals( $expectedHeaders,
$htmlTable->getHeaders() );
+ $this->assertEquals( $expectedHeaders, $htmlTable->getHeaders()
);
$this->assertEquals( $expectedIsSortable,
$htmlTable->isSortable() );
}
@@ -101,7 +106,7 @@
)
);
- $this->assertArrayEquals(
+ $this->assertEquals(
array (
array (
new HtmlTableCellBuilder( 'foo' ),
@@ -115,7 +120,11 @@
/**
* @dataProvider appendRowsDataProvider
*/
- public function testAppendRows( $rows, $expectedRows,
$expectedException = null ) {
+ public function testAppendRows(
+ array $rows,
+ array $expectedRows = null,
+ $expectedException = null
+ ) {
if ( $expectedException ) {
$this->setExpectedException( $expectedException );
}
@@ -128,7 +137,7 @@
);
$htmlTable->appendRows( $rows );
- $this->assertArrayEquals( $expectedRows, $htmlTable->getRows()
);
+ $this->assertEquals( $expectedRows, $htmlTable->getRows() );
}
/**
@@ -273,4 +282,5 @@
return $cellMock;
}
+
}
diff --git a/tests/phpunit/Html/HtmlTableCellBuilderTest.php
b/tests/phpunit/Html/HtmlTableCellBuilderTest.php
index beced73..73a801c 100644
--- a/tests/phpunit/Html/HtmlTableCellBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableCellBuilderTest.php
@@ -1,10 +1,9 @@
<?php
-
namespace WikibaseQuality\ExternalValidation\Tests\Html;
+use PHPUnit_Framework_TestCase;
use WikibaseQuality\Html\HtmlTableCellBuilder;
-
/**
* @covers WikibaseQuality\Html\HtmlTableCellBuilder
@@ -14,7 +13,7 @@
* @author BP2014N1
* @license GNU GPL v2+
*/
-class HtmlTableCellBuilderTest extends \MediaWikiTestCase {
+class HtmlTableCellBuilderTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider constructDataProvider
@@ -92,4 +91,5 @@
)
);
}
+
}
diff --git a/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
b/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
index be6e292..90aaa36 100644
--- a/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
@@ -1,10 +1,9 @@
<?php
-
namespace WikibaseQuality\ExternalValidation\Tests\Html;
+use PHPUnit_Framework_TestCase;
use WikibaseQuality\Html\HtmlTableHeaderBuilder;
-
/**
* @covers WikibaseQuality\Html\HtmlTableHeaderBuilder
@@ -14,7 +13,7 @@
* @author BP2014N1
* @license GNU GPL v2+
*/
-class HtmlTableHeaderBuilderTest extends \MediaWikiTestCase {
+class HtmlTableHeaderBuilderTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider constructDataProvider
@@ -80,4 +79,5 @@
)
);
}
+
}
--
To view, visit https://gerrit.wikimedia.org/r/274406
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71cdcd7c1b16b06f74014018155e5806abab71c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQuality
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits