[Pkg-owncloud-commits] [owncloud] 55/58: Add unit tests

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 15:58:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.6
in repository owncloud.

commit 11dc65e76c096c7169cbf25f9b24925fb8f62c14
Author: Lukas Reschke <lukas at owncloud.com>
Date:   Mon Jul 27 11:18:41 2015 +0200

    Add unit tests
---
 tests/lib/files/utils/scanner.php | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tests/lib/files/utils/scanner.php b/tests/lib/files/utils/scanner.php
index 65ddfe4..6728271 100644
--- a/tests/lib/files/utils/scanner.php
+++ b/tests/lib/files/utils/scanner.php
@@ -150,4 +150,32 @@ class Scanner extends \Test\TestCase {
 		$newInfo = $cache->get('');
 		$this->assertNotEquals($oldInfo['etag'], $newInfo['etag']);
 	}
+
+	/**
+	 * @return array
+	 */
+	public function invalidPathProvider() {
+		return [
+			[
+				'../',
+			],
+			[
+				'..\\',
+			],
+			[
+				'../..\\../',
+			],
+		];
+	}
+
+	/**
+	 * @dataProvider invalidPathProvider
+	 * @expectedException \InvalidArgumentException
+	 * @expectedExceptionMessage Invalid path to scan
+	 * @param string $invalidPath
+	 */
+	public function testInvalidPathScanning($invalidPath) {
+		$scanner = new TestScanner('', \OC::$server->getDatabaseConnection());
+		$scanner->scan($invalidPath);
+	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list