Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita53b450

Browse files
committed
do not use mocks in tests when not necessary
1 parenta90648c commita53b450

File tree

39 files changed

+1284
-2213
lines changed

39 files changed

+1284
-2213
lines changed

‎src/Symfony/Component/Form/Tests/AbstractFormTest.php

Lines changed: 0 additions & 77 deletions
This file was deleted.

‎src/Symfony/Component/Form/Tests/AbstractRequestHandlerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
useSymfony\Component\Form\FormBuilder;
1919
useSymfony\Component\Form\FormError;
2020
useSymfony\Component\Form\FormFactory;
21-
useSymfony\Component\Form\FormFactoryInterface;
21+
useSymfony\Component\Form\FormRegistry;
2222
useSymfony\Component\Form\Forms;
2323
useSymfony\Component\Form\RequestHandlerInterface;
24+
useSymfony\Component\Form\ResolvedFormTypeFactory;
2425
useSymfony\Component\Form\Util\ServerParams;
2526

2627
/**
@@ -417,7 +418,7 @@ protected function createForm($name, $method = null, $compound = false)
417418

418419
protectedfunctioncreateBuilder($name,$compound =false,array$options = [])
419420
{
420-
$builder =newFormBuilder($name,null,newEventDispatcher(),$this->createMock(FormFactoryInterface::class),$options);
421+
$builder =newFormBuilder($name,null,newEventDispatcher(),newFormFactory(newFormRegistry([],newResolvedFormTypeFactory())),$options);
421422
$builder->setCompound($compound);
422423

423424
if ($compound) {

‎src/Symfony/Component/Form/Tests/ButtonTest.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,19 @@
1212
namespaceSymfony\Component\Form\Tests;
1313

1414
usePHPUnit\Framework\TestCase;
15-
useSymfony\Component\EventDispatcher\EventDispatcherInterface;
15+
useSymfony\Component\EventDispatcher\EventDispatcher;
1616
useSymfony\Component\Form\ButtonBuilder;
1717
useSymfony\Component\Form\Exception\AlreadySubmittedException;
1818
useSymfony\Component\Form\FormBuilder;
19-
useSymfony\Component\Form\FormFactoryInterface;
19+
useSymfony\Component\Form\FormFactory;
20+
useSymfony\Component\Form\FormRegistry;
21+
useSymfony\Component\Form\ResolvedFormTypeFactory;
2022

2123
/**
2224
* @author Bernhard Schussek <bschussek@gmail.com>
2325
*/
2426
class ButtonTestextends TestCase
2527
{
26-
private$dispatcher;
27-
28-
private$factory;
29-
30-
protectedfunctionsetUp():void
31-
{
32-
$this->dispatcher =$this->createMock(EventDispatcherInterface::class);
33-
$this->factory =$this->createMock(FormFactoryInterface::class);
34-
}
35-
3628
publicfunctiontestSetParentOnSubmittedButton()
3729
{
3830
$this->expectException(AlreadySubmittedException::class);
@@ -83,6 +75,6 @@ private function getButtonBuilder($name)
8375

8476
privatefunctiongetFormBuilder()
8577
{
86-
returnnewFormBuilder('form',null,$this->dispatcher,$this->factory);
78+
returnnewFormBuilder('form',null,newEventDispatcher(),newFormFactory(newFormRegistry([],newResolvedFormTypeFactory())));
8779
}
8880
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp