Index: tests/phpunit/data/formatting/markers.txt
===================================================================
--- tests/phpunit/data/formatting/markers.txt	(nonexistent)
+++ tests/phpunit/data/formatting/markers.txt	(working copy)
@@ -0,0 +1,24 @@
+
+# BEGIN Empty
+# END Empty
+
+# BEGIN FooBar
+FooBar line
+# END FooBar
+
+# BEGIN Foo Bar
+Foo Bar line
+# END Foo Bar
+
+# BEGIN Foo
+Foo line
+# END Foo
+
+# BEGIN Multiline
+
+Multiline 2
+Multiline 3
+
+Multiline 5
+
+# END Multiline
Index: tests/phpunit/tests/admin/includesMisc.php
===================================================================
--- tests/phpunit/tests/admin/includesMisc.php	(revision 40811)
+++ tests/phpunit/tests/admin/includesMisc.php	(working copy)
@@ -22,4 +22,80 @@
 		foreach ( $tests as $k => $v )
 			$this->assertEquals( $v, url_shorten( $k ) );
 	}
+
+	function test_extract_from_markers() {
+		$filename = DIR_TESTDATA . '/formatting/markers.txt';
+
+		// Assert that section marked with marker that is prefix of another marker is extracted correctly.
+		$test_foo = array(
+			'Foo line',
+		);
+		$this->assertEquals( $test_foo, extract_from_markers( $filename, 'Foo' ) );
+
+		// Assert that section marked by marker with spaces is extracted correctly.
+		$test_foo_bar = array(
+			'Foo Bar line',
+		);
+		$this->assertEquals( $test_foo_bar, extract_from_markers( $filename, 'Foo Bar' ) );
+
+		// Assert that section with multiple lines (including empty lines) is extracted correctly.
+		$test_wordpress = array(
+			'',
+			'Multiline 2',
+			'Multiline 3',
+			'',
+			'Multiline 5',
+			'',
+		);
+		$this->assertEquals( $test_wordpress, extract_from_markers( $filename, 'Multiline' ) );
+
+		// Assert that empty array is returned for empty section.
+		$this->assertEquals( array(), extract_from_markers( $filename, 'Empty' ) );
+
+		// Assert that empty array is returned for non-existing section.
+		$this->assertEquals( array(), extract_from_markers( $filename, 'Null' ) );
+
+		// Assert that empty array is returned if file does not exists.
+		$this->assertEquals( array(), extract_from_markers( rand_str(), 'Foo' ) );
+	}
+
+	/**
+	 * @ticket 26829
+	 */
+	function test_split_by_markers() {
+		// Test data
+		$pre = array(
+			'# BEGIN FooPre',
+			'Line before',
+			'# END FooPre',
+		);
+		$in = array(
+			'# BEGIN Foo',
+			'Line in',
+			'# END Foo',
+		);
+		$post = array (
+			'# BEGIN FooPost',
+			'Line after',
+			'# END FooPost',
+		);
+
+		$lines = array_merge($pre, $in, $post);
+
+		// Assert correct results when splitting by FooPre
+		$this->assertEquals(
+			array( array(), array( 'Line before' ), array_merge( $in, $post ) ),
+			split_by_markers( $lines, 'FooPre' )
+		);
+		// Assert correct results when splitting by Foo
+		$this->assertEquals(
+			array( $pre, array( 'Line in' ), $post ),
+			split_by_markers( $lines, 'Foo' )
+		);
+		// Assert correct results when splitting by FooPost
+		$this->assertEquals(
+			array( array_merge($pre, $in), array( 'Line after' ), array() ),
+			split_by_markers( $lines, 'FooPost' )
+		);
+	}
 }
