summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-11 11:40:51 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-11 11:40:51 +0100
commit6317ba8cb4fef328bf828eab5197cc58f7057221 (patch)
treec54316e17a23a2a29f5a61391fb433c1436a8cf8 /tests
parent86bd95ea1b19a42b2a41f8851f7451d38c92957b (diff)
parent2f3b10f980db9a54fc0022c69387ae5d7d9c0914 (diff)
downloadnextcloud-server-6317ba8cb4fef328bf828eab5197cc58f7057221.tar.gz
nextcloud-server-6317ba8cb4fef328bf828eab5197cc58f7057221.zip
Merge pull request #21135 from owncloud/add-polyfill
Add polyfills for PHP55, PHP56 and PHP70 functionalities
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/security/securerandom.php7
-rw-r--r--tests/lib/security/stringutils.php38
2 files changed, 3 insertions, 42 deletions
diff --git a/tests/lib/security/securerandom.php b/tests/lib/security/securerandom.php
index d9bbd0e71e5..af437640805 100644
--- a/tests/lib/security/securerandom.php
+++ b/tests/lib/security/securerandom.php
@@ -57,11 +57,10 @@ class SecureRandomTest extends \Test\TestCase {
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Generator is not initialized
+ * @dataProvider stringGenerationProvider
*/
- function testUninitializedGenerate() {
- $this->rng->generate(30);
+ function testUninitializedGenerate($length, $expectedLength) {
+ $this->assertEquals($expectedLength, strlen($this->rng->generate($length)));
}
/**
diff --git a/tests/lib/security/stringutils.php b/tests/lib/security/stringutils.php
deleted file mode 100644
index 060315debb4..00000000000
--- a/tests/lib/security/stringutils.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-use \OC\Security\StringUtils;
-
-class StringUtilsTest extends \Test\TestCase {
-
- public function dataProvider()
- {
- return array(
- array('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.', 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'),
- array('', ''),
- array('我看这本书。 我看這本書', '我看这本书。 我看這本書'),
- array('GpKY9fSnWNJbES99zVGvA', 'GpKY9fSnWNJbES99zVGvA')
- );
- }
-
- /**
- * @dataProvider dataProvider
- */
- function testWrongEquals($string) {
- $this->assertFalse(StringUtils::equals($string, 'A Completely Wrong String'));
- $this->assertFalse(StringUtils::equals($string, null));
- }
-
- /**
- * @dataProvider dataProvider
- */
- function testTrueEquals($string, $expected) {
- $this->assertTrue(StringUtils::equals($string, $expected));
- }
-
-}