svn:eol-style native
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 5 Nov 2009 17:55:01 +0000 (17:55 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 5 Nov 2009 17:55:01 +0000 (17:55 +0000)
t/inc/SearchUpdate.t

index da061f7..b670f2d 100644 (file)
@@ -1,61 +1,61 @@
-#!/usr/bin/env php\r
-<?php\r
-\r
-require 't/Test.php';\r
-\r
-plan( 4 );\r
-\r
-define( 'MEDIAWIKI', 1 );\r
-require 'includes/Defines.php';\r
-require 'includes/ProfilerStub.php';\r
-require 'includes/AutoLoader.php';\r
-require 'LocalSettings.php';\r
-\r
-require 't/DatabaseMock.inc';\r
-\r
-$wgSearchType = 'MockSearch';\r
-\r
-require 'includes/Setup.php';\r
-\r
-\r
-class MockSearch extends SearchEngine {\r
-       public static $id;\r
-       public static $title;\r
-       public static $text;\r
-\r
-       public function __construct( $db ) {\r
-       }\r
-\r
-       public function update( $id, $title, $text ) {\r
-               self::$id = $id;\r
-               self::$title = $title;\r
-               self::$text = $text;\r
-       }\r
-}\r
-\r
-function update( $text, $title = 'Test', $id = 1 ) {\r
-       $u = new SearchUpdate( $id, $title, $text );\r
-       $u->doUpdate();\r
-       return array( MockSearch::$title, MockSearch::$text );\r
-}\r
-\r
-function updateText( $text ) {\r
-       list( $title, $resultText ) = update( $text );\r
-       $resultText = trim( $resultText ); // abstract from some implementation details\r
-       return $resultText;\r
-}\r
-\r
-is( updateText( '<div>TeSt</div>' ), 'test', 'HTML stripped, text lowercased' );\r
-\r
-is( updateText( <<<EOT\r
-<table style="color:red; font-size:100px">\r
-       <tr class="scary"><td><div>foo</div></td><tr>bar</td></tr>\r
-       <tr><td>boz</td><tr>quux</td></tr>\r
-</table>\r
-EOT\r
-), 'foo bar boz quux', 'Stripping HTML tables' );\r
-\r
-is( updateText( 'a > b' ), 'a b', 'Handle unclosed tags' );\r
-\r
-$text = str_pad( "foo <barbarbar \n", 10000, 'x' );\r
+#!/usr/bin/env php
+<?php
+
+require 't/Test.php';
+
+plan( 4 );
+
+define( 'MEDIAWIKI', 1 );
+require 'includes/Defines.php';
+require 'includes/ProfilerStub.php';
+require 'includes/AutoLoader.php';
+require 'LocalSettings.php';
+
+require 't/DatabaseMock.inc';
+
+$wgSearchType = 'MockSearch';
+
+require 'includes/Setup.php';
+
+
+class MockSearch extends SearchEngine {
+       public static $id;
+       public static $title;
+       public static $text;
+
+       public function __construct( $db ) {
+       }
+
+       public function update( $id, $title, $text ) {
+               self::$id = $id;
+               self::$title = $title;
+               self::$text = $text;
+       }
+}
+
+function update( $text, $title = 'Test', $id = 1 ) {
+       $u = new SearchUpdate( $id, $title, $text );
+       $u->doUpdate();
+       return array( MockSearch::$title, MockSearch::$text );
+}
+
+function updateText( $text ) {
+       list( $title, $resultText ) = update( $text );
+       $resultText = trim( $resultText ); // abstract from some implementation details
+       return $resultText;
+}
+
+is( updateText( '<div>TeSt</div>' ), 'test', 'HTML stripped, text lowercased' );
+
+is( updateText( <<<EOT
+<table style="color:red; font-size:100px">
+       <tr class="scary"><td><div>foo</div></td><tr>bar</td></tr>
+       <tr><td>boz</td><tr>quux</td></tr>
+</table>
+EOT
+), 'foo bar boz quux', 'Stripping HTML tables' );
+
+is( updateText( 'a > b' ), 'a b', 'Handle unclosed tags' );
+
+$text = str_pad( "foo <barbarbar \n", 10000, 'x' );
 ok( updateText( $text ) != '', 'Bug 18609' );
\ No newline at end of file