Code Duplication    Length = 15-48 lines in 3 locations

tests/phpunit/tests/formatting/redirect.php 1 location

@@ 51-65 (lines=15) @@
48
		$this->assertEquals( false, wp_validate_redirect( $url, false ) );
49
	}
50
51
	function valid_url_provider() {
52
		return array(
53
			array( 'http://example.com', 'http://example.com' ),
54
			array( 'http://example.com/', 'http://example.com/' ),
55
			array( 'https://example.com/', 'https://example.com/' ),
56
			array( '//example.com', 'http://example.com' ),
57
			array( '//example.com/', 'http://example.com/' ),
58
			array( 'http://example.com/?foo=http://example.com/', 'http://example.com/?foo=http://example.com/' ),
59
			array( 'http://[email protected]/', 'http://[email protected]/' ),
60
			array( 'http://user:@example.com/', 'http://user:@example.com/' ),
61
			array( 'http://user:[email protected]/', 'http://user:[email protected]/' ),
62
			array( " \t\n\r\0\x08\x0Bhttp://example.com", 'http://example.com' ),
63
			array( " \t\n\r\0\x08\x0B//example.com", 'http://example.com' ),
64
		);
65
	}
66
67
	function invalid_url_provider() {
68
		return array(

tests/phpunit/tests/formatting/WPTexturize.php 1 location

@@ 968-1015 (lines=48) @@
965
		return $this->assertEquals( $output, wptexturize( $input ) );
966
	}
967
968
	function data_cockney() {
969
		return array(
970
			array(
971
				"word 'tain't word",
972
				"word ’tain’t word",
973
			),
974
			array(
975
				"word 'twere word",
976
				"word ’twere word",
977
			),
978
			array(
979
				"word 'twas word",
980
				"word ’twas word",
981
			),
982
			array(
983
				"word 'tis word",
984
				"word ’tis word",
985
			),
986
			array(
987
				"word 'twill word",
988
				"word ’twill word",
989
			),
990
			array(
991
				"word 'til word",
992
				"word ’til word",
993
			),
994
			array(
995
				"word 'bout word",
996
				"word ’bout word",
997
			),
998
			array(
999
				"word 'nuff word",
1000
				"word ’nuff word",
1001
			),
1002
			array(
1003
				"word 'round word",
1004
				"word ’round word",
1005
			),
1006
			array(
1007
				"word 'cause word",
1008
				"word ’cause word",
1009
			),
1010
			array(
1011
				"word 'em word",
1012
				"word ’em word",
1013
			),
1014
		);
1015
	}
1016
1017
	/**
1018
	 * Test smart dashes.

tests/phpunit/tests/functions.php 1 location

@@ 106-123 (lines=18) @@
103
	function test_wp_normalize_path( $path, $expected ) {
104
		$this->assertEquals( $expected, wp_normalize_path( $path ) );
105
	}
106
	function data_wp_normalize_path() {
107
		return array(
108
			// Windows paths
109
			array( 'C:\\www\\path\\', 'C:/www/path/' ),
110
			array( 'C:\\www\\\\path\\', 'C:/www/path/' ),
111
			array( 'c:/www/path', 'C:/www/path' ),
112
			array( 'c:\\www\\path\\', 'C:/www/path/' ), // uppercase drive letter
113
			array( 'c:\\\\www\\path\\', 'C:/www/path/' ),
114
			array( '\\\\Domain\\DFSRoots\\share\\path\\', '//Domain/DFSRoots/share/path/' ),
115
			array( '\\\\Server\\share\\path', '//Server/share/path' ),
116
			array( '\\\\Server\\share', '//Server/share' ),
117
118
			// Linux paths
119
			array( '/www/path/', '/www/path/' ),
120
			array( '/www/path/////', '/www/path/' ),
121
			array( '/www/path', '/www/path' ),
122
		);
123
	}
124
125
	function test_wp_unique_filename() {
126