commit
df35929ed2
@ -0,0 +1,71 @@ |
||||
<?php |
||||
/** |
||||
* ownCloud |
||||
* |
||||
* @author Arthur Schiwon |
||||
* @copyright 2013 Arthur Schiwon blizzz@owncloud.com |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Affero General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
namespace OCA\user_ldap\tests; |
||||
|
||||
use \OCA\user_ldap\lib\Access; |
||||
use \OCA\user_ldap\lib\Connection; |
||||
use \OCA\user_ldap\lib\ILDAPWrapper; |
||||
|
||||
class Test_Access extends \PHPUnit_Framework_TestCase { |
||||
private function getConnecterAndLdapMock() { |
||||
static $conMethods; |
||||
static $accMethods; |
||||
|
||||
if(is_null($conMethods) || is_null($accMethods)) { |
||||
$conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); |
||||
$accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); |
||||
} |
||||
$lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); |
||||
$connector = $this->getMock('\OCA\user_ldap\lib\Connection', |
||||
$conMethods, |
||||
array($lw, null, null)); |
||||
|
||||
return array($lw, $connector); |
||||
} |
||||
|
||||
public function testEscapeFilterPartValidChars() { |
||||
list($lw, $con) = $this->getConnecterAndLdapMock(); |
||||
$access = new Access($con, $lw); |
||||
|
||||
$input = 'okay'; |
||||
$this->assertTrue($input === $access->escapeFilterPart($input)); |
||||
} |
||||
|
||||
public function testEscapeFilterPartEscapeWildcard() { |
||||
list($lw, $con) = $this->getConnecterAndLdapMock(); |
||||
$access = new Access($con, $lw); |
||||
|
||||
$input = '*'; |
||||
$expected = '\\\\*'; |
||||
$this->assertTrue($expected === $access->escapeFilterPart($input)); |
||||
} |
||||
|
||||
public function testEscapeFilterPartEscapeWildcard2() { |
||||
list($lw, $con) = $this->getConnecterAndLdapMock(); |
||||
$access = new Access($con, $lw); |
||||
|
||||
$input = 'foo*bar'; |
||||
$expected = 'foo\\\\*bar'; |
||||
$this->assertTrue($expected === $access->escapeFilterPart($input)); |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
@media only screen and (max-width: 600px) { |
||||
|
||||
/* compress search box on mobile, expand when focused */ |
||||
.searchbox input[type="search"] { |
||||
width: 15%; |
||||
-webkit-transition: width 100ms; |
||||
-moz-transition: width 100ms; |
||||
-o-transition: width 100ms; |
||||
transition: width 100ms; |
||||
} |
||||
.searchbox input[type="search"]:focus, |
||||
.searchbox input[type="search"]:active { |
||||
width: 155px; |
||||
} |
||||
|
||||
/* do not show display name on mobile when profile picture is present */ |
||||
#header .avatardiv.avatardiv-shown + #expandDisplayName { |
||||
display: none; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,34 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2014 Bjoern Schiessle <schiessle@owncloud.com> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
class Test_Urlgenerator extends PHPUnit_Framework_TestCase { |
||||
|
||||
|
||||
/** |
||||
* @small |
||||
* @brief test absolute URL construction |
||||
* @dataProvider provideURLs |
||||
*/ |
||||
function testGetAbsoluteURL($url, $expectedResult) { |
||||
|
||||
$urlGenerator = new \OC\URLGenerator(null); |
||||
$result = $urlGenerator->getAbsoluteURL($url); |
||||
|
||||
$this->assertEquals($expectedResult, $result); |
||||
} |
||||
|
||||
public function provideURLs() { |
||||
return array( |
||||
array("index.php", "http://localhost/index.php"), |
||||
array("/index.php", "http://localhost/index.php"), |
||||
array("/apps/index.php", "http://localhost/apps/index.php"), |
||||
array("apps/index.php", "http://localhost/apps/index.php"), |
||||
); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue