[Pkg-owncloud-commits] [owncloud] 101/131: Add unit tests

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


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

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

commit 4ee61f3c7a9d25011cb03f8f4b443313b4e54a4e
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 ca64b1d..75cd75e 100644
--- a/tests/lib/files/utils/scanner.php
+++ b/tests/lib/files/utils/scanner.php
@@ -189,4 +189,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