Code Duplication    Length = 9-10 lines in 4 locations

tests/phpunit/tests/formatting/EscUrl.php 2 locations

@@ 11-19 (lines=9) @@
8
	/**
9
	 * @ticket 23605
10
	 */
11
	function test_spaces() {
12
		$this->assertEquals( 'http://example.com/Mr%20WordPress',    esc_url( 'http://example.com/Mr WordPress' ) );
13
		$this->assertEquals( 'http://example.com/Mr%20WordPress',    esc_url( 'http://example.com/Mr%20WordPress' ) );
14
		$this->assertEquals( 'http://example.com/Mr%20%20WordPress', esc_url( 'http://example.com/Mr%20%20WordPress' ) );
15
		$this->assertEquals( 'http://example.com/Mr+WordPress',      esc_url( 'http://example.com/Mr+WordPress' ) );
16
17
		$this->assertEquals( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one two three&bar=four' ) );
18
		$this->assertEquals( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) );
19
	}
20
21
	function test_bad_characters() {
22
		$this->assertEquals('http://example.com/watchthelinefeedgo', esc_url('http://example.com/watchthelinefeed%0Ago'));
@@ 216-225 (lines=10) @@
213
	/** 
214
	 * @ticket 34202
215
	 */
216
	function test_ipv6_hosts() {
217
		$this->assertEquals( '//[::127.0.0.1]', esc_url( '//[::127.0.0.1]' ) );
218
		$this->assertEquals( 'http://[::FFFF::127.0.0.1]', esc_url( 'http://[::FFFF::127.0.0.1]' ) );
219
		$this->assertEquals( 'http://[::127.0.0.1]', esc_url( 'http://[::127.0.0.1]' ) );
220
		$this->assertEquals( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]', esc_url( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]' ) );
221
222
		// IPv6 with square brackets in the query? Why not.
223
		$this->assertEquals( '//[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( '//[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
224
		$this->assertEquals( 'http://[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( 'http://[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
225
	}
226
227
}
228

tests/phpunit/tests/formatting/WPTexturize.php 2 locations

@@ 155-164 (lines=10) @@
152
		$this->assertEquals('14×24', wptexturize("14x24"));
153
	}
154
155
	function test_minutes_seconds() {
156
		$this->assertEquals('9′', wptexturize('9\''));
157
		$this->assertEquals('9″', wptexturize("9\""));
158
159
		$this->assertEquals('a 9′ b', wptexturize('a 9\' b'));
160
		$this->assertEquals('a 9″ b', wptexturize("a 9\" b"));
161
162
		$this->assertEquals('“a 9′ b”', wptexturize('"a 9\' b"'));
163
		$this->assertEquals('‘a 9″ b’', wptexturize("'a 9\" b'"));
164
	}
165
166
	/**
167
	 * @ticket 8775
@@ 227-235 (lines=9) @@
224
	/**
225
	 * @ticket 31030
226
	 */
227
	function test_hyphens_at_start_and_end() {
228
		$this->assertEquals( '– ', wptexturize( '- ' ) );
229
		$this->assertEquals( '– –', wptexturize( '- -' ) );
230
		$this->assertEquals( ' –', wptexturize( ' -' ) );
231
232
		$this->assertEquals( '— ', wptexturize( '-- ' ) );
233
		$this->assertEquals( '— —', wptexturize( '-- --' ) );
234
		$this->assertEquals( ' —', wptexturize( ' --' ) );
235
	}
236
237
	/**
238
	 * Test spaces around quotes.