Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?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;
use Symfony\Component\HttpFoundation\Response;
class QrCodeControllerTest extends WebTestCase
{
public function testGenerateAction()
{
$client = static::createClient();
$client->request('GET', $client->getContainer()->get('router')->generate('endroid_qrcode_generate', [
'text' => 'Life is too short to be generating QR codes',
'extension' => 'png',
'size' => 200,
'margin' => 10,
'label' => 'Scan the code',
'label_font_size' => 16,
]));
$response = $client->getResponse();
$image = imagecreatefromstring($response->getContent());
$this->assertTrue(220 == imagesx($image));
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
}
public function testTwigFunctionsAction()
{
$client = static::createClient();
$client->request('GET', $client->getContainer()->get('router')->generate('endroid_qrcode_twig_functions'));
$response = $client->getResponse();
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
}
}

View File

@@ -0,0 +1,20 @@
<?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;
use PHPUnit\Framework\TestCase;
class EndroidQrCodeBundleTest extends TestCase
{
public function testNoTestsYet()
{
$this->assertTrue(true);
}
}

View File

@@ -0,0 +1,2 @@
/cache
/logs

View File

@@ -0,0 +1,36 @@
<?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.
*/
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
/**
* {@inheritdoc}
*/
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Endroid\QrCode\Bundle\QrCodeBundle\EndroidQrCodeBundle(),
];
return $bundles;
}
/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config.yml');
}
}

View File

@@ -0,0 +1,3 @@
<?php
$loader = require __DIR__.'/../../../vendor/autoload.php';

View File

@@ -0,0 +1,8 @@
framework:
test: ~
secret: ThisTokenIsNotSoSecretChangeIt
templating:
engines: ['twig']
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~

View File

@@ -0,0 +1,3 @@
EndroidQrCodeBundle:
resource: "@EndroidQrCodeBundle/Resources/config/routing.yml"
prefix: /qrcode