login consent app sql

This commit is contained in:
2022-05-03 08:54:45 +02:00
parent e7253acfd8
commit f9a6535906
1652 changed files with 187600 additions and 45 deletions

View File

@ -0,0 +1,18 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test;
use Symfony\Component\Form\FormBuilderInterface as BaseFormBuilderInterface;
interface FormBuilderInterface extends \Iterator, BaseFormBuilderInterface
{
}

View File

@ -0,0 +1,57 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\Forms;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class FormIntegrationTestCase extends TestCase
{
/**
* @var FormFactoryInterface
*/
protected $factory;
protected function setUp(): void
{
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions($this->getExtensions())
->addTypeExtensions($this->getTypeExtensions())
->addTypes($this->getTypes())
->addTypeGuessers($this->getTypeGuessers())
->getFormFactory();
}
protected function getExtensions()
{
return [];
}
protected function getTypeExtensions()
{
return [];
}
protected function getTypes()
{
return [];
}
protected function getTypeGuessers()
{
return [];
}
}

View File

@ -0,0 +1,18 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test;
use Symfony\Component\Form\FormInterface as BaseFormInterface;
interface FormInterface extends \Iterator, BaseFormInterface
{
}

View File

@ -0,0 +1,66 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test;
use Symfony\Component\Form\Tests\VersionAwareTest;
/**
* Base class for performance tests.
*
* Copied from Doctrine 2's OrmPerformanceTestCase.
*
* @author robo
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class FormPerformanceTestCase extends FormIntegrationTestCase
{
use VersionAwareTest;
/**
* @var int
*/
protected $maxRunningTime = 0;
/**
* {@inheritdoc}
*/
protected function runTest()
{
$s = microtime(true);
parent::runTest();
$time = microtime(true) - $s;
if (0 != $this->maxRunningTime && $time > $this->maxRunningTime) {
$this->fail(sprintf('expected running time: <= %s but was: %s', $this->maxRunningTime, $time));
}
}
/**
* @throws \InvalidArgumentException
*/
public function setMaxRunningTime(int $maxRunningTime)
{
if ($maxRunningTime < 0) {
throw new \InvalidArgumentException();
}
$this->maxRunningTime = $maxRunningTime;
}
/**
* @return int
*/
public function getMaxRunningTime()
{
return $this->maxRunningTime;
}
}

View File

@ -0,0 +1,44 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test\Traits;
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
use Symfony\Component\Form\Test\TypeTestCase;
use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Validator\ValidatorInterface;
trait ValidatorExtensionTrait
{
/**
* @var ValidatorInterface|null
*/
protected $validator;
protected function getValidatorExtension(): ValidatorExtension
{
if (!interface_exists(ValidatorInterface::class)) {
throw new \Exception('In order to use the "ValidatorExtensionTrait", the symfony/validator component must be installed.');
}
if (!$this instanceof TypeTestCase) {
throw new \Exception(sprintf('The trait "ValidatorExtensionTrait" can only be added to a class that extends "%s".', TypeTestCase::class));
}
$this->validator = $this->createMock(ValidatorInterface::class);
$metadata = $this->getMockBuilder(ClassMetadata::class)->setConstructorArgs([''])->setMethods(['addPropertyConstraint'])->getMock();
$this->validator->expects($this->any())->method('getMetadataFor')->will($this->returnValue($metadata));
$this->validator->expects($this->any())->method('validate')->will($this->returnValue(new ConstraintViolationList()));
return new ValidatorExtension($this->validator, false);
}
}

View File

@ -0,0 +1,65 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\Test\Traits\ValidatorExtensionTrait;
abstract class TypeTestCase extends FormIntegrationTestCase
{
/**
* @var FormBuilder
*/
protected $builder;
/**
* @var EventDispatcherInterface
*/
protected $dispatcher;
protected function setUp(): void
{
parent::setUp();
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
$this->builder = new FormBuilder('', null, $this->dispatcher, $this->factory);
}
protected function tearDown(): void
{
if (\in_array(ValidatorExtensionTrait::class, class_uses($this))) {
$this->validator = null;
}
}
protected function getExtensions()
{
$extensions = [];
if (\in_array(ValidatorExtensionTrait::class, class_uses($this))) {
$extensions[] = $this->getValidatorExtension();
}
return $extensions;
}
public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
{
self::assertEquals($expected->format('c'), $actual->format('c'));
}
public static function assertDateIntervalEquals(\DateInterval $expected, \DateInterval $actual)
{
self::assertEquals($expected->format('%RP%yY%mM%dDT%hH%iM%sS'), $actual->format('%RP%yY%mM%dDT%hH%iM%sS'));
}
}