Skip to content

Commit

Permalink
Merge pull request #758 from franmomu/tests_fixes
Browse files Browse the repository at this point in the history
Avoid deprecations in tests using Symfony >= 6.1
  • Loading branch information
malarzm authored Jan 7, 2023
2 parents 7de77d5 + af2b2ee commit 4413d92
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
1 change: 1 addition & 0 deletions Tests/Command/CommandTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$container->loadFromExtension('framework', [
'secret' => 'foo',
'router' => ['utf8' => false],
'http_method_override' => false,
]);

$container->loadFromExtension('doctrine_mongodb', [
Expand Down
1 change: 1 addition & 0 deletions Tests/FixtureIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
$c->loadFromExtension('framework', [
'secret' => 'foo',
'router' => ['utf8' => false],
'http_method_override' => false,
]);

$callback = $this->servicesCallback;
Expand Down
7 changes: 1 addition & 6 deletions Tests/Fixtures/Form/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ public function __construct(string $name)
$this->documents = new ArrayCollection();
}

/**
* Converts to string
*
* @return string
**/
public function __toString()
public function __toString(): string
{
return $this->name;
}
Expand Down
7 changes: 1 addition & 6 deletions Tests/Fixtures/Form/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ public function __construct(ObjectId $id, string $name)
$this->categories = new ArrayCollection();
}

/**
* Converts to string
*
* @return string
**/
public function __toString()
public function __toString(): string
{
return $this->name;
}
Expand Down
15 changes: 3 additions & 12 deletions Tests/Form/Type/GuesserTestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

class GuesserTestType extends AbstractType
{
/**
* @return void
*/
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name')
Expand All @@ -28,20 +25,14 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('nonMappedField');
}

/**
* @return void
*/
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Guesser::class,
])->setRequired('dm');
}

/**
* {@inheritDoc}
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'guesser_test';
}
Expand Down

0 comments on commit 4413d92

Please sign in to comment.