Merge branch 'master' into loops
This commit is contained in:
31
core/lib/Thelia/Tests/Core/Security/Encoder/PasswordPhpCompatEncoderTest.php
Executable file
31
core/lib/Thelia/Tests/Core/Security/Encoder/PasswordPhpCompatEncoderTest.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* User: manu
|
||||
* Date: 09/07/13
|
||||
* Time: 10:02
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
|
||||
namespace Thelia\Tests\Security\Encoder;
|
||||
|
||||
|
||||
use Thelia\Core\Security\Encoder\PasswordPhpCompatEncoder;
|
||||
|
||||
class PasswordPhpCompatEncoderTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
protected $encoder;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->encoder = new PasswordPhpCompatEncoder();
|
||||
}
|
||||
|
||||
public function testEncode()
|
||||
{
|
||||
$hash = $this->encoder->encode("foo", PASSWORD_BCRYPT);
|
||||
|
||||
$this->assertEquals($hash, crypt("foo", $hash));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program 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 General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Tests\Security;
|
||||
|
||||
use Thelia\Core\Security\SecurityManager;
|
||||
/**
|
||||
*
|
||||
* @author Franck Allimant <franck@cqfdev.fr>
|
||||
*
|
||||
*/
|
||||
class SecurityManagerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testGetSetToken()
|
||||
{
|
||||
/*
|
||||
$context = new SecurityManager($authProvider)(
|
||||
$this->getMock('AuthenticationProviderInterface'),
|
||||
$this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface')
|
||||
);
|
||||
$this->assertNull($context->getToken());
|
||||
|
||||
$context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
|
||||
$this->assertSame($token, $context->getToken());
|
||||
*/
|
||||
// $this->assertFalse(1==1, "faux !");
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
use Thelia\Core\Security\Token\UsernamePasswordToken;
|
||||
|
||||
class UsernamePasswordTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testConstructor()
|
||||
{
|
||||
$token = new UsernamePasswordToken('username', 'password');
|
||||
|
||||
$this->assertFalse($token->isAuthenticated());
|
||||
|
||||
$token = new UsernamePasswordToken('username', 'password', true);
|
||||
$this->assertTrue($token->isAuthenticated());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function testSetAuthenticatedToTrue()
|
||||
{
|
||||
$token = new UsernamePasswordToken('foo', 'bar', true);
|
||||
$token->setAuthenticated(true);
|
||||
}
|
||||
|
||||
public function testSetAuthenticatedToFalse()
|
||||
{
|
||||
$token = new UsernamePasswordToken('foo', 'bar', true);
|
||||
$token->setAuthenticated(false);
|
||||
$this->assertFalse($token->isAuthenticated());
|
||||
}
|
||||
|
||||
public function testEraseCredentials()
|
||||
{
|
||||
$token = new UsernamePasswordToken('foo', 'bar', true);
|
||||
$token->eraseCredentials();
|
||||
$this->assertEquals('', $token->getCredentials());
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,8 @@ class TlogTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $logger;
|
||||
|
||||
protected $regex = "/(\\d)(:)(\\s+)(%s)(\\s+)(\\[.*?\\])(\\s+)(\\{.*?\\})(\\s+)((?:2|1)\\d{3}(?:-|\\/)(?:(?:0[1-9])|(?:1[0-2]))(?:-|\\/)(?:(?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))(?:T|\\s)(?:(?:[0-1][0-9])|(?:2[0-3])):(?:[0-5][0-9]):(?:[0-5][0-9]))(.)(\\s+)(%s)([\n])/is";
|
||||
//protected $regex = "/(\\d)(:)(\\s+)(%s)(\\s+)(\\[.*?\\])(\\s+)(\\{.*?\\})(\\s+)(\\d{4})(-)(\\d{2})(-)(\\d{2})(\\s+)(\\d{2})(:)(\\d{2})(:)(\\d{2})(:)(\\s+)(%s)([\n])/is";
|
||||
protected $regex = "/[0-9]+:[\s](%s)+[\s]\[[a-zA-Z\.]+:[a-zA-Z]+\(\)\][\s]\{[0-9]+\}[\s][0-9]{4}-[0-9]{2}-[0-9]{2}[\s][0-9]{2}:[0-9]{2}:[0-9]{2}:[\s](%s).*$/is";
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user