mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-10-01 01:26:10 -04:00
apply StyleCI patch
This commit is contained in:
parent
74519f6c4f
commit
95ed1251a3
@ -816,7 +816,7 @@ class ControllerTest extends PHPUnit_Framework_TestCase
|
|||||||
$token = base64_encode(hash_hmac(
|
$token = base64_encode(hash_hmac(
|
||||||
'sha256', Helper::getPasteId(), random_bytes(32), true
|
'sha256', Helper::getPasteId(), random_bytes(32), true
|
||||||
));
|
));
|
||||||
$burnPaste = Helper::getPaste(2, array('challenge' => $token));
|
$burnPaste = Helper::getPaste(2, array('challenge' => $token));
|
||||||
$burnPaste['adata'][3] = 1;
|
$burnPaste['adata'][3] = 1;
|
||||||
$this->_data->create(Helper::getPasteId(), $burnPaste);
|
$this->_data->create(Helper::getPasteId(), $burnPaste);
|
||||||
$this->assertTrue($this->_data->exists(Helper::getPasteId()), 'paste exists before deleting data');
|
$this->assertTrue($this->_data->exists(Helper::getPasteId()), 'paste exists before deleting data');
|
||||||
@ -841,7 +841,7 @@ class ControllerTest extends PHPUnit_Framework_TestCase
|
|||||||
$token = base64_encode(hash_hmac(
|
$token = base64_encode(hash_hmac(
|
||||||
'sha256', Helper::getPasteId(), random_bytes(32), true
|
'sha256', Helper::getPasteId(), random_bytes(32), true
|
||||||
));
|
));
|
||||||
$burnPaste = Helper::getPaste(2, array('challenge' => base64_encode(random_bytes(32))));
|
$burnPaste = Helper::getPaste(2, array('challenge' => base64_encode(random_bytes(32))));
|
||||||
$burnPaste['adata'][3] = 1;
|
$burnPaste['adata'][3] = 1;
|
||||||
$this->_data->create(Helper::getPasteId(), $burnPaste);
|
$this->_data->create(Helper::getPasteId(), $burnPaste);
|
||||||
$this->assertTrue($this->_data->exists(Helper::getPasteId()), 'paste exists before deleting data');
|
$this->assertTrue($this->_data->exists(Helper::getPasteId()), 'paste exists before deleting data');
|
||||||
|
@ -274,9 +274,9 @@ class ModelTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testToken()
|
public function testToken()
|
||||||
{
|
{
|
||||||
$pasteData = Helper::getPastePost();
|
$pasteData = Helper::getPastePost();
|
||||||
$pasteData['meta']['challenge'] = base64_encode(random_bytes(32));
|
$pasteData['meta']['challenge'] = base64_encode(random_bytes(32));
|
||||||
$token = base64_encode(hash_hmac(
|
$token = base64_encode(hash_hmac(
|
||||||
'sha256', Helper::getPasteId(), base64_decode($pasteData['meta']['challenge']), true
|
'sha256', Helper::getPasteId(), base64_decode($pasteData['meta']['challenge']), true
|
||||||
));
|
));
|
||||||
$this->_model->getPaste(Helper::getPasteId())->delete();
|
$this->_model->getPaste(Helper::getPasteId())->delete();
|
||||||
@ -331,7 +331,7 @@ class ModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testInvalidFormat()
|
public function testInvalidFormat()
|
||||||
{
|
{
|
||||||
$pasteData = Helper::getPastePost();
|
$pasteData = Helper::getPastePost();
|
||||||
$pasteData['adata'][1] = 'foo';
|
$pasteData['adata'][1] = 'foo';
|
||||||
$this->_model->getPaste(Helper::getPasteId())->delete();
|
$this->_model->getPaste(Helper::getPasteId())->delete();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user