More cleanups and fixes
This commit is contained in:
parent
b9b9a993ba
commit
4fdbbe21fb
@ -429,10 +429,10 @@ class AbstractControllerTest extends TestCase
|
||||
{
|
||||
$formView = new FormView();
|
||||
|
||||
$form = $this->getMockBuilder(FormInterface::class)->getMock();
|
||||
$form = $this->createMock(FormInterface::class);
|
||||
$form->expects($this->once())->method('createView')->willReturn($formView);
|
||||
|
||||
$twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock();
|
||||
$twig = $this->createMock(Environment::class);
|
||||
$twig->expects($this->once())->method('render')->with('foo', ['form' => $formView, 'bar' => 'bar'])->willReturn('bar');
|
||||
|
||||
$container = new Container();
|
||||
@ -451,12 +451,12 @@ class AbstractControllerTest extends TestCase
|
||||
{
|
||||
$formView = new FormView();
|
||||
|
||||
$form = $this->getMockBuilder(FormInterface::class)->getMock();
|
||||
$form = $this->createMock(FormInterface::class);
|
||||
$form->expects($this->once())->method('createView')->willReturn($formView);
|
||||
$form->expects($this->once())->method('isSubmitted')->willReturn(true);
|
||||
$form->expects($this->once())->method('isValid')->willReturn(false);
|
||||
|
||||
$twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock();
|
||||
$twig = $this->createMock(Environment::class);
|
||||
$twig->expects($this->once())->method('render')->with('foo', ['form' => $formView, 'bar' => 'bar'])->willReturn('bar');
|
||||
|
||||
$container = new Container();
|
||||
|
@ -44,7 +44,7 @@ class AccessDecisionManagerTest extends TestCase
|
||||
*/
|
||||
public function testDeprecatedVoter($strategy)
|
||||
{
|
||||
$token = $this->getMockBuilder(\Symfony\Component\Security\Core\Authentication\Token\TokenInterface::class)->getMock();
|
||||
$token = $this->createMock(TokenInterface::class);
|
||||
$manager = new AccessDecisionManager([$this->getVoter(3)], $strategy);
|
||||
|
||||
$this->expectDeprecation('Since symfony/security-core 5.3: Returning "3" in "%s::vote()" is deprecated, return one of "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface" constants: "ACCESS_GRANTED", "ACCESS_DENIED" or "ACCESS_ABSTAIN".');
|
||||
|
@ -74,7 +74,7 @@ class ArrayDenormalizerTest extends TestCase
|
||||
*/
|
||||
public function testDenormalizeLegacy()
|
||||
{
|
||||
$serializer = $this->getMockBuilder(Serializer::class)->getMock();
|
||||
$serializer = $this->createMock(Serializer::class);
|
||||
|
||||
$serializer->expects($this->exactly(2))
|
||||
->method('denormalize')
|
||||
|
Reference in New Issue
Block a user