shlink/module/Common/test/Response/QrCodeResponseTest.php

22 lines
567 B
PHP
Raw Normal View History

2018-11-17 21:23:25 +03:00
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Common\Response;
use Endroid\QrCode\QrCode;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
class QrCodeResponseTest extends TestCase
{
2019-02-17 22:28:34 +03:00
/** @test */
2018-11-17 21:23:25 +03:00
public function providedQrCoideIsSetAsBody()
{
$qrCode = new QrCode('Hello');
$resp = new QrCodeResponse($qrCode);
$this->assertEquals($qrCode->getContentType(), $resp->getHeaderLine('Content-Type'));
$this->assertEquals($qrCode->get(), (string) $resp->getBody());
}
}