MDL-86320 core: Fix unit test qrcode_test
This commit is contained in:
committed by
Huong Nguyen
parent
0fa4c468c9
commit
dfc522ccbb
@@ -26,8 +26,8 @@ use core_qrcode;
|
||||
* @author <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(core_qrcode::class)]
|
||||
final class qrcode_test extends \basic_testcase {
|
||||
|
||||
/**
|
||||
* Basic test to generate a QR code and check that the library is not broken.
|
||||
*/
|
||||
@@ -36,9 +36,9 @@ final class qrcode_test extends \basic_testcase {
|
||||
// binary file can be different. This is why tests are limited.
|
||||
|
||||
$text = 'abc';
|
||||
$color = 'black';
|
||||
$qrcode = new core_qrcode($text, $color);
|
||||
$svgdata = $qrcode->getBarcodeSVGcode(1, 1);
|
||||
$color = 'green';
|
||||
$qrcode = new core_qrcode($text);
|
||||
$svgdata = $qrcode->getBarcodeSVGcode(1, 1, $color);
|
||||
|
||||
// Just check the SVG was generated.
|
||||
$this->assertStringContainsString('<desc>' . $text . '</desc>', $svgdata);
|
||||
|
||||
Reference in New Issue
Block a user