r99960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99959‎ | r99960 | r99961 >
Date:18:35, 16 October 2011
Author:demon
Status:ok
Tags:
Comment:
Initial tests for wfShorthandToInteger(). Definitely needs more
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php (added) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php
@@ -0,0 +1,24 @@
 2+<?php
 3+
 4+class wfShorthandToIntegerTest extends MediaWikiTestCase {
 5+ /**
 6+ * @dataProvider provideABunchOfShorthands
 7+ */
 8+ function testWfShorthandToInteger( $input, $output, $description ) {
 9+ $this->assertEquals(
 10+ wfShorthandToInteger( $input ),
 11+ $output,
 12+ $description
 13+ );
 14+ }
 15+
 16+ function provideABunchOfShorthands() {
 17+ return array(
 18+ array( '', -1, 'Empty string' ),
 19+ array( ' ', -1, 'String of spaces' ),
 20+ array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ),
 21+ array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ),
 22+ );
 23+ }
 24+
 25+}
Property changes on: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php
___________________________________________________________________
Added: svn:eol-style
126 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r102595Move tests that have likely never been executed. Now they will be executed....gicode23:11, 9 November 2011

Status & tagging log