审查视图

vendor/endroid/qr-code/tests/Bundle/Controller/QrCodeControllerTest.php 915 字节
王智 authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
<?php

/*
 * (c) Jeroen van den Enden <info@endroid.nl>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Endroid\QrCode\Tests\Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class QrCodeControllerTest extends WebTestCase
{
    /**
     * Tests if the QR code generation route returns a success response.
     */
    public function testCreateQrCode()
    {
        $client = static::createClient();

        $client->request('GET', $client->getContainer()->get('router')->generate('endroid_qrcode', [
            'text' => 'Life is too short to be generating QR codes',
            'extension' => 'png',
            'size' => 150,
            'label' => 'Dit is een label',
            'label_font_size' => 16,
        ]));

        $this->assertEquals(200, $client->getResponse()->getStatusCode());
    }
}