summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/specials
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/includes/specials
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/includes/specials')
-rw-r--r--tests/phpunit/includes/specials/SpecialBooksourcesTest.php36
-rw-r--r--tests/phpunit/includes/specials/SpecialMIMESearchTest.php4
2 files changed, 38 insertions, 2 deletions
diff --git a/tests/phpunit/includes/specials/SpecialBooksourcesTest.php b/tests/phpunit/includes/specials/SpecialBooksourcesTest.php
new file mode 100644
index 00000000..69485a03
--- /dev/null
+++ b/tests/phpunit/includes/specials/SpecialBooksourcesTest.php
@@ -0,0 +1,36 @@
+<?php
+class SpecialBooksourcesTest extends MediaWikiTestCase {
+ public static function provideISBNs() {
+ return array(
+ array( '978-0-300-14424-6', true ),
+ array( '0-14-020652-3', true ),
+ array( '020652-3', false ),
+ array( '9781234567897', true ),
+ array( '1-4133-0454-0', true ),
+ array( '978-1413304541', true ),
+ array( '0136091814', true ),
+ array( '0136091812', false ),
+ array( '9780136091813', true ),
+ array( '9780136091817', false ),
+ array( '123456789X', true ),
+
+ // Bug 67021
+ array( '1413304541', false ),
+ array( '141330454X', false ),
+ array( '1413304540', true ),
+ array( '14133X4540', false ),
+ array( '97814133X4541', false ),
+ array( '978035642615X', false ),
+ array( '9781413304541', true ),
+ array( '9780356426150', true ),
+ );
+ }
+
+ /**
+ * @covers SpecialBookSources::isValidISBN
+ * @dataProvider provideISBNs
+ */
+ public function testIsValidISBN( $isbn, $isValid ) {
+ $this->assertSame( $isValid, SpecialBookSources::isValidISBN( $isbn ) );
+ }
+}
diff --git a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php
index 14d19685..fe1c9e83 100644
--- a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php
+++ b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php
@@ -5,11 +5,11 @@
class SpecialMIMESearchTest extends MediaWikiTestCase {
- /** @var MIMESearchPage */
+ /** @var MIMEsearchPage */
private $page;
function setUp() {
- $this->page = new MIMESearchPage;
+ $this->page = new MIMEsearchPage;
$context = new RequestContext();
$context->setTitle( Title::makeTitle( NS_SPECIAL, 'MIMESearch' ) );
$context->setRequest( new FauxRequest() );