mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-26 00:05:19 -04:00
update test to use a Jdenticon
This commit is contained in:
parent
07caf3ff64
commit
7b444bf62b
1 changed files with 11 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
use Identicon\Identicon;
|
use Jdenticon\Identicon;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use PrivateBin\Configuration;
|
use PrivateBin\Configuration;
|
||||||
use PrivateBin\Data\Database;
|
use PrivateBin\Data\Database;
|
||||||
|
@ -308,8 +308,15 @@ class ModelTest extends TestCase
|
||||||
$comment->get();
|
$comment->get();
|
||||||
$comment->store();
|
$comment->store();
|
||||||
|
|
||||||
$identicon = new Identicon();
|
$identicon = new Identicon(array(
|
||||||
$pngdata = $identicon->getImageDataUri(TrafficLimiter::getHash(), 16);
|
'hash' => TrafficLimiter::getHash(),
|
||||||
|
'size' => 16,
|
||||||
|
'style' => array(
|
||||||
|
'backgroundColor' => '#fff0', // fully transparent, for dark mode
|
||||||
|
'padding' => 0,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
$pngdata = $identicon->getImageDataUri('png');
|
||||||
$comment = current($this->_model->getPaste(Helper::getPasteId())->get()['comments']);
|
$comment = current($this->_model->getPaste(Helper::getPasteId())->get()['comments']);
|
||||||
$this->assertEquals($pngdata, $comment['meta']['icon'], 'icon gets set');
|
$this->assertEquals($pngdata, $comment['meta']['icon'], 'icon gets set');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue