mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 13:03:20 +00:00
Move CSRFTestProvider class to a PSR 0 compatible file
This commit is contained in:
25
tests/classes/CrsfTestProvider.php
Normal file
25
tests/classes/CrsfTestProvider.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is used to provided CRSF token in PHPUNIT test suite.
|
||||||
|
*/
|
||||||
|
class CsrfTestProvider implements CsrfProviderInterface
|
||||||
|
{
|
||||||
|
public function generateCsrfToken($intention)
|
||||||
|
{
|
||||||
|
return mt_rand();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isCsrfTokenValid($intention, $token)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@@ -988,21 +988,3 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
|||||||
->getMock();
|
->getMock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CsrfTestProvider implements CsrfProviderInterface
|
|
||||||
{
|
|
||||||
public function generateCsrfToken($intention)
|
|
||||||
{
|
|
||||||
return mt_rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isCsrfTokenValid($intention, $token)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class PDOMock extends \PDO
|
|
||||||
{
|
|
||||||
public function __construct() {}
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user