Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build tools #484

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.php-cs-fixer.cache
.php-cs-fixer.php
.phpunit.result.cache
coverage
composer.lock
phpunit.xml
/.phpunit.cache/
/build/
/vendor/
!/vendor-bin/tools/composer.lock
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"symfony/options-resolver": "^5.4 || ^6.2",
"symfony/property-access": "^5.4 || ^6.2",
"symfony/translation": "^5.4 || ^6.2",
"symfony/validator": "^5.4 || ^6.2"
"symfony/validator": "^5.4.22 || ^6.2.8"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.5",
Expand Down
16 changes: 7 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage/>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>
Expand All @@ -13,7 +9,9 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
1 change: 0 additions & 1 deletion src/Bridge/Symfony/Resources/config/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@
->tag('form.type_extension', [
'extended-type' => FileType::class,
])

;
};
1 change: 0 additions & 1 deletion src/Bridge/Symfony/Resources/config/form_doctrine.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
->args([
service('doctrine'),
])

;
};
1 change: 0 additions & 1 deletion src/Bridge/Symfony/Resources/config/validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@

->set(BatchTimeAfterValidator::class)
->tag('validator.constraint_validator', [])

;
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Form\Test\TypeTestCase;

/**
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
abstract class BaseTypeTest extends TypeTestCase
abstract class BaseTypeTestCase extends TypeTestCase
{
public function testPassDisabledAsOption(): void
{
Expand Down Expand Up @@ -209,5 +210,8 @@ protected function createBuilder(array $parentOptions = [], array $childOptions
;
}

/**
* @return class-string<FormTypeInterface<mixed>>
*/
abstract protected function getTestedType(): string;
}
2 changes: 1 addition & 1 deletion tests/Type/BatchTimeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Nucleos\Form\Type\BatchTimeType;
use Symfony\Component\Form\Extension\Core\Type\FormType;

final class BatchTimeTypeTest extends BaseTypeTest
final class BatchTimeTypeTest extends BaseTypeTestCase
{
public function testGetParent(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/DACHCountryTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;

final class DACHCountryTypeTest extends BaseTypeTest
final class DACHCountryTypeTest extends BaseTypeTestCase
{
public function testCountriesAreSelectable(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/DateOutputTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Nucleos\Form\Type\DateOutputType;

final class DateOutputTypeTest extends BaseTypeTest
final class DateOutputTypeTest extends BaseTypeTestCase
{
public function testSubmitNull($expected = null, $norm = null, $view = ''): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/DoctrineDiscriminatorTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormTypeInterface;

final class DoctrineDiscriminatorTypeTest extends BaseTypeTest
final class DoctrineDiscriminatorTypeTest extends BaseTypeTestCase
{
/**
* @var ManagerRegistry&MockObject
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/GenderTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;

final class GenderTypeTest extends BaseTypeTest
final class GenderTypeTest extends BaseTypeTestCase
{
public function testGendersAreSelectable(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/JsonTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Nucleos\Form\Type\JsonType;

final class JsonTypeTest extends BaseTypeTest
final class JsonTypeTest extends BaseTypeTestCase
{
public function testSubmitNull($expected = [], $norm = null, $view = ''): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/NumberOutputTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Nucleos\Form\Type\NumberOutputType;

final class NumberOutputTypeTest extends BaseTypeTest
final class NumberOutputTypeTest extends BaseTypeTestCase
{
public function testSubmitNull($expected = null, $norm = null, $view = ''): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/OutputTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Nucleos\Form\Type\OutputType;

final class OutputTypeTest extends BaseTypeTest
final class OutputTypeTest extends BaseTypeTestCase
{
public function testSubmitNull($expected = null, $norm = null, $view = ''): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/TimePickerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Nucleos\Form\Type\TimePickerType;

final class TimePickerTypeTest extends BaseTypeTest
final class TimePickerTypeTest extends BaseTypeTestCase
{
public function testSubmitNull($expected = null, $norm = null, $view = ''): void
{
Expand Down
28 changes: 14 additions & 14 deletions tests/Validator/Constraints/BatchTimeAfterValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testValidateInvalidFirstField(): void
$end->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getEnd'])
->addMethods(['getEnd'])
->getMock()
;
$object->method('getEnd')->willReturn($end);
Expand All @@ -82,7 +82,7 @@ public function testValidateInvalidSecondField(): void
$begin->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin'])
->addMethods(['getBegin'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand All @@ -105,7 +105,7 @@ public function testValidateInvalidFirstValue(): void
$begin->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand All @@ -129,7 +129,7 @@ public function testValidateInvalidSecondValue(): void
$end->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn('test');
Expand All @@ -151,7 +151,7 @@ public function testValidateEmptyFirstValue(): void
$end->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn(null);
Expand Down Expand Up @@ -182,7 +182,7 @@ public function testValidateEmptySecondValue(): void
$begin->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand Down Expand Up @@ -216,7 +216,7 @@ public function testValidateDatesInvalid(): void
$end->setTime(new DateTime('2015-01-01 10:00'));

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand Down Expand Up @@ -250,7 +250,7 @@ public function testValidateDatesValid(): void
$end->setTime(new DateTime('2015-02-01 10:00'));

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand All @@ -277,7 +277,7 @@ public function testValidateEqualDate(): void
$end->setTime(new DateTime('2015-01-01 10:00'));

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand All @@ -298,7 +298,7 @@ public function testValidateEqualDate(): void
public function testValidateNotRequired(): void
{
$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn(null);
Expand All @@ -323,7 +323,7 @@ public function testValidateNotRequiredWithEmptyFirst(): void
$end->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn(null);
Expand Down Expand Up @@ -355,7 +355,7 @@ public function testValidateNotRequiredWithEmptySecond(): void
$begin->setTime(new DateTime());

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand Down Expand Up @@ -389,7 +389,7 @@ public function testValidateEmptyFirstValueDate(): void
$end->setTime(new DateTime('2015-02-01 10:00'));

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand Down Expand Up @@ -422,7 +422,7 @@ public function testValidateEmptySecondValueDate(): void
$end = new BatchTime();

$object = $this->getMockBuilder('stdClass')
->setMethods(['getBegin', 'getEnd'])
->addMethods(['getBegin', 'getEnd'])
->getMock()
;
$object->method('getBegin')->willReturn($begin);
Expand Down
Loading