<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[802] trunk/wp-testcase/test_includes_formatting.php: Port formatting tests.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://unit-tests.trac.wordpress.org/changeset/802">802</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-06-30 20:30:59 +0000 (Sat, 30 Jun 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Port formatting tests. fixes <a href="http://unit-tests.trac.wordpress.org/ticket/79">#79</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwptestcasetest_includes_formattingphp">trunk/wp-testcase/test_includes_formatting.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwptestcasetest_includes_formattingphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-testcase/test_includes_formatting.php (801 => 802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-testcase/test_includes_formatting.php        2012-06-30 20:24:36 UTC (rev 801)
+++ trunk/wp-testcase/test_includes_formatting.php        2012-06-30 20:30:59 UTC (rev 802)
</span><span class="lines">@@ -1,6 +1,9 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><del>-class TestMakeClickable extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestMakeClickable extends WP_UnitTestCase {
</ins><span class="cx">         function test_mailto_xss() {
</span><span class="cx">                 $in = 'testzzz@&quot;STYLE=&quot;behavior:url(\'#default#time2\')&quot;onBegin=&quot;alert(\'refresh-XSS\')&quot;';
</span><span class="cx">                 $this-&gt;assertEquals($in, make_clickable($in));
</span><span class="lines">@@ -339,7 +342,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestJSEscape extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestJSEscape extends WP_UnitTestCase {
</ins><span class="cx">         function test_js_escape_simple() {
</span><span class="cx">                 $out = esc_js('foo bar baz();');
</span><span class="cx">                 $this-&gt;assertEquals('foo bar baz();', $out);
</span><span class="lines">@@ -381,7 +387,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestHtmlExcerpt extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestHtmlExcerpt extends WP_UnitTestCase {
</ins><span class="cx">         function test_simple() {
</span><span class="cx">                 $this-&gt;assertEquals(&quot;Baba&quot;, wp_html_excerpt(&quot;Baba told me not to come&quot;, 4));
</span><span class="cx">         }
</span><span class="lines">@@ -397,7 +406,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* // @todo These tests need to be rewritten for sanitize_sql_orderby
</span><del>-class TestSanitizeOrderby extends WPTestCase {
</del><ins>+class TestSanitizeOrderby extends WP_UnitTestCase {
</ins><span class="cx">         function test_empty() {
</span><span class="cx">                 $cols = array('a' =&gt; 'a');
</span><span class="cx">                 $this-&gt;assertEquals( '', sanitize_sql_orderby('', $cols) );
</span><span class="lines">@@ -433,7 +442,10 @@
</span><span class="cx"> }
</span><span class="cx"> */
</span><span class="cx"> 
</span><del>-class TestWPTexturize extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestWPTexturize extends WP_UnitTestCase {
</ins><span class="cx">         function test_dashes() {
</span><span class="cx">                 $this-&gt;assertEquals('Hey &amp;#8212; boo?', wptexturize('Hey -- boo?'));
</span><span class="cx">                 $this-&gt;assertEquals('&lt;a href=&quot;http://xx--xx&quot;&gt;Hey &amp;#8212; boo?&lt;/a&gt;', wptexturize('&lt;a href=&quot;http://xx--xx&quot;&gt;Hey -- boo?&lt;/a&gt;'));
</span><span class="lines">@@ -590,7 +602,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestEscUrl extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestEscUrl extends WP_UnitTestCase {
</ins><span class="cx">         function test_spaces() {
</span><span class="cx">                 $this-&gt;assertEquals('http://example.com/MrWordPress', esc_url('http://example.com/Mr WordPress'));
</span><span class="cx">                 $this-&gt;assertEquals('http://example.com/Mr%20WordPress', esc_url('http://example.com/Mr%20WordPress'));
</span><span class="lines">@@ -652,7 +667,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestAutop extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestAutop extends WP_UnitTestCase {
</ins><span class="cx">         //From ticket http://core.trac.wordpress.org/ticket/11008
</span><span class="cx">         function test_first_post() {
</span><span class="cx">                 $expected = '&lt;p&gt;Welcome to WordPress!  This post contains important information.  After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.&lt;/p&gt;
</span><span class="lines">@@ -751,7 +769,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestLikeEscape extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestLikeEscape extends WP_UnitTestCase {
</ins><span class="cx">         function test_like_escape() {
</span><span class="cx">                 $this-&gt;knownWPBug(10041);
</span><span class="cx"> 
</span><span class="lines">@@ -774,7 +795,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSanitizeTextField extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSanitizeTextField extends WP_UnitTestCase {
</ins><span class="cx">         // #11528
</span><span class="cx">         function test_sanitize_text_field() {
</span><span class="cx">                 $inputs = array(
</span><span class="lines">@@ -817,7 +841,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSanitizeMimeType extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSanitizeMimeType extends WP_UnitTestCase {
</ins><span class="cx">         // 17855
</span><span class="cx">         function test_sanitize_valid_mime_type() {
</span><span class="cx">                 $inputs = array(
</span><span class="lines">@@ -851,7 +878,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSanitizeFileName extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSanitizeFileName extends WP_UnitTestCase {
</ins><span class="cx">         function test_munges_extensions() {
</span><span class="cx">                 # r17990
</span><span class="cx">                 $file_name = sanitize_file_name( 'test.phtml.txt' );
</span><span class="lines">@@ -881,7 +911,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestWPSpecialchars extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestWPSpecialchars extends WP_UnitTestCase {
</ins><span class="cx">         function test_wp_specialchars_basics() {
</span><span class="cx">                 $html =  &quot;&amp;amp;&amp;lt;hello world&amp;gt;&quot;;
</span><span class="cx">                 $this-&gt;assertEquals( $html, _wp_specialchars( $html ) );
</span><span class="lines">@@ -919,7 +952,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestEscAttr extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestEscAttr extends WP_UnitTestCase {
</ins><span class="cx">         function test_esc_attr_quotes() {
</span><span class="cx">                 $attr = '&quot;double quotes&quot;';
</span><span class="cx">                 $this-&gt;assertEquals( '&amp;quot;double quotes&amp;quot;', esc_attr( $attr ) );
</span><span class="lines">@@ -947,7 +983,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestEscHtml extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestEscHtml extends WP_UnitTestCase {
</ins><span class="cx">         function test_esc_html_basics() {
</span><span class="cx">                 // Simple string
</span><span class="cx">                 $html = &quot;The quick brown fox.&quot;;
</span><span class="lines">@@ -983,7 +1022,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSanitizeUser extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSanitizeUser extends WP_UnitTestCase {
</ins><span class="cx">         function test_strips_html() {
</span><span class="cx">                 $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
</span><span class="cx">                 $expected = is_multisite() ? 'captain awesome' : 'Captain Awesome';
</span><span class="lines">@@ -1004,7 +1046,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestIsEmail extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestIsEmail extends WP_UnitTestCase {
</ins><span class="cx">         function test_returns_true_if_given_a_valid_email_address() {
</span><span class="cx">                 $data = array(
</span><span class="cx">                         &quot;bob@example.com&quot;,
</span><span class="lines">@@ -1031,7 +1076,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSanitizeTitle extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSanitizeTitle extends WP_UnitTestCase {
</ins><span class="cx">         function test_strips_html() {
</span><span class="cx">                 $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
</span><span class="cx">                 $expected = &quot;captain-awesome&quot;;
</span><span class="lines">@@ -1045,7 +1093,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSanitizeTitleWithDashes extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSanitizeTitleWithDashes extends WP_UnitTestCase {
</ins><span class="cx">         function test_strips_html() {
</span><span class="cx">                 $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
</span><span class="cx">                 $expected = &quot;captain-awesome&quot;;
</span><span class="lines">@@ -1135,7 +1186,10 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestConvertChars extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestConvertChars extends WP_UnitTestCase {
</ins><span class="cx">         function test_replaces_windows1252_entities_with_unicode_ones() {
</span><span class="cx">                 $input = &quot;&amp;#130;&amp;#131;&amp;#132;&amp;#133;&amp;#134;&amp;#135;&amp;#136;&amp;#137;&amp;#138;&amp;#139;&amp;#140;&amp;#145;&amp;#146;&amp;#147;&amp;#148;&amp;#149;&amp;#150;&amp;#151;&amp;#152;&amp;#153;&amp;#154;&amp;#155;&amp;#156;&amp;#159;&quot;;
</span><span class="cx">                 $output = &quot;&amp;#8218;&amp;#402;&amp;#8222;&amp;#8230;&amp;#8224;&amp;#8225;&amp;#710;&amp;#8240;&amp;#352;&amp;#8249;&amp;#338;&amp;#8216;&amp;#8217;&amp;#8220;&amp;#8221;&amp;#8226;&amp;#8211;&amp;#8212;&amp;#732;&amp;#8482;&amp;#353;&amp;#8250;&amp;#339;&amp;#376;&quot;;
</span><span class="lines">@@ -1169,7 +1223,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestZeroise extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestZeroise extends WP_UnitTestCase {
</ins><span class="cx">         function test_pads_with_leading_zeroes() {
</span><span class="cx">                 $this-&gt;assertEquals(&quot;00005&quot;, zeroise(5, 5));
</span><span class="cx">         }
</span><span class="lines">@@ -1179,7 +1236,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestBackslashit extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestBackslashit extends WP_UnitTestCase {
</ins><span class="cx">         function test_backslashes_alphas() {
</span><span class="cx">                 $this-&gt;assertEquals(&quot;\\a943\\b\\c&quot;, backslashit(&quot;a943bc&quot;));
</span><span class="cx">         }
</span><span class="lines">@@ -1189,14 +1249,20 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestUntrailingslashit extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestUntrailingslashit extends WP_UnitTestCase {
</ins><span class="cx">         function test_removes_trailing_slashes() {
</span><span class="cx">                 $this-&gt;assertEquals(&quot;a&quot;, untrailingslashit(&quot;a/&quot;));
</span><span class="cx">                 $this-&gt;assertEquals(&quot;a&quot;, untrailingslashit(&quot;a////&quot;));
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestTrailingslashit extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestTrailingslashit extends WP_UnitTestCase {
</ins><span class="cx">         function test_adds_trailing_slash() {
</span><span class="cx">                 $this-&gt;assertEquals(&quot;a/&quot;, trailingslashit(&quot;a&quot;));
</span><span class="cx">         }
</span><span class="lines">@@ -1206,9 +1272,13 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-/* The `clean_pre` function removes pararaph and line break
-   tags within `&lt;pre&gt;` elements as part of `wpautop`. */
-class TestCleanPre extends WPTestCase {
</del><ins>+/**
+ * The clean_pre() removes pararaph and line break
+ * tags within `&lt;pre&gt;` elements as part of wpautop().
+ *
+ * @group formatting
+ */
+class TestCleanPre extends WP_UnitTestCase {
</ins><span class="cx">         function test_removes_self_closing_br_with_space() {
</span><span class="cx">                 $source = 'a b c\n&lt;br /&gt;sldfj&lt;br /&gt;';
</span><span class="cx">                 $res = 'a b c\nsldfj';
</span><span class="lines">@@ -1239,7 +1309,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestSmilies extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestSmilies extends WP_UnitTestCase {
</ins><span class="cx"> 
</span><span class="cx">         function test_convert_smilies() {
</span><span class="cx">                 global $wpsmiliestrans;
</span><span class="lines">@@ -1319,7 +1392,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestWPTrimWords extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestWPTrimWords extends WP_UnitTestCase {
</ins><span class="cx">         private $long_text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius lacinia vehicula. Etiam sapien risus, ultricies ac posuere eu, convallis sit amet augue. Pellentesque urna massa, lacinia vel iaculis eget, bibendum in mauris. Aenean eleifend pulvinar ligula, a convallis eros gravida non. Suspendisse potenti. Pellentesque et odio tortor. In vulputate pellentesque libero, sed dapibus velit mollis viverra. Pellentesque id urna euismod dolor cursus sagittis.';
</span><span class="cx"> 
</span><span class="cx">         function test_trims_to_55_by_default() {
</span><span class="lines">@@ -1360,7 +1436,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestRemoveAccents extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestRemoveAccents extends WP_UnitTestCase {
</ins><span class="cx">         public function test_remove_accents_simple() {
</span><span class="cx">                 $this-&gt;assertEquals( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );
</span><span class="cx">         }
</span><span class="lines">@@ -1435,7 +1514,10 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class TestStripSlashesDeep extends WPTestCase {
</del><ins>+/**
+ * @group formatting
+ */
+class TestStripSlashesDeep extends WP_UnitTestCase {
</ins><span class="cx">         function test_preserves_original_datatype() {
</span><span class="cx">                 $this-&gt;knownWPBug(18026);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>