mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-04 02:29:13 +00:00
* switch to composer for qrcode and otp dependencies
* move most OTP-related stuff into userhelper * remove old phpqrcode and otphp libraries
This commit is contained in:
66
vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
vendored
Normal file
66
vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Class QRImagickTest
|
||||
*
|
||||
* @filesource QRImagickTest.php
|
||||
* @created 04.07.2018
|
||||
* @package chillerlan\QRCodeTest\Output
|
||||
* @author smiley <smiley@chillerlan.net>
|
||||
* @copyright 2018 smiley
|
||||
* @license MIT
|
||||
*
|
||||
* @noinspection PhpComposerExtensionStubsInspection
|
||||
*/
|
||||
|
||||
namespace chillerlan\QRCodeTest\Output;
|
||||
|
||||
use Imagick;
|
||||
use chillerlan\QRCode\{QRCode, Output\QRImagick};
|
||||
|
||||
class QRImagickTest extends QROutputTestAbstract{
|
||||
|
||||
protected $FQCN = QRImagick::class;
|
||||
|
||||
public function setUp():void{
|
||||
|
||||
if(!extension_loaded('imagick')){
|
||||
$this->markTestSkipped('ext-imagick not loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function testImageOutput(){
|
||||
$type = QRCode::OUTPUT_IMAGICK;
|
||||
|
||||
$this->options->outputType = $type;
|
||||
$this->setOutputInterface();
|
||||
$this->outputInterface->dump($this::cachefile.$type);
|
||||
$img = $this->outputInterface->dump();
|
||||
|
||||
$this->assertSame($img, file_get_contents($this::cachefile.$type));
|
||||
}
|
||||
|
||||
public function testSetModuleValues(){
|
||||
|
||||
$this->options->moduleValues = [
|
||||
// data
|
||||
1024 => '#4A6000',
|
||||
4 => '#ECF9BE',
|
||||
];
|
||||
|
||||
$this->setOutputInterface()->dump();
|
||||
|
||||
$this->assertTrue(true); // tricking the code coverage
|
||||
}
|
||||
|
||||
public function testOutputGetResource():void{
|
||||
$this->options->returnResource = true;
|
||||
|
||||
$this->setOutputInterface();
|
||||
|
||||
$this::assertInstanceOf(Imagick::class, $this->outputInterface->dump());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user