Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakiboy committed Jan 5, 2018
1 parent 52d9f4f commit ebc160a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Tests/Form/DateNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,13 @@ private function getForm(array $transformers)

return $form;
}

protected function getMock($originalClassName)
{
if (method_exists($this, 'createMock')) {
return $this->createMock($originalClassName);
}

return parent::getMock($originalClassName);
}
}
13 changes: 11 additions & 2 deletions Tests/Twig/GenemuFormExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GenemuFormExtensionTest extends \PHPUnit_Framework_TestCase
public function it_registers_functions()
{
$twig = new \Twig_Environment(new \Twig_Loader_Array());
$twig->addExtension(new GenemuFormExtension($this->getMock('Symfony\Bridge\Twig\Form\TwigRendererInterface')));
$twig->addExtension(new GenemuFormExtension($this->getMock('Symfony\Component\Form\FormRendererInterface')));

$f1 = $twig->getFunction('form_javascript');
$f2 = $twig->getFunction('form_stylesheet');
Expand All @@ -29,7 +29,7 @@ public function it_proxies_to_form_renderer()
{
$view = new FormView();

$renderer = $this->getMock('Symfony\Bridge\Twig\Form\TwigRendererInterface');
$renderer = $this->getMock('Symfony\Component\Form\FormRendererInterface');
$renderer
->expects($this->exactly(3))
->method('searchAndRenderBlock')
Expand All @@ -47,4 +47,13 @@ public function it_proxies_to_form_renderer()
call_user_func($twig->getFunction('form_javascript')->getCallable(), $view, true);
call_user_func($twig->getFunction('form_stylesheet')->getCallable(), $view);
}

protected function getMock($originalClassName)
{
if (method_exists($this, 'createMock')) {
return $this->createMock($originalClassName);
}

return parent::getMock($originalClassName);
}
}
4 changes: 2 additions & 2 deletions Twig/GenemuFormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Devmachine\Bundle\FormBundle\Twig;

use Symfony\Bridge\Twig\Form\TwigRendererInterface;
use Symfony\Component\Form\FormRendererInterface;
use Symfony\Component\Form\FormView;

/**
Expand All @@ -12,7 +12,7 @@ class GenemuFormExtension extends \Twig_Extension
{
public $renderer;

public function __construct(TwigRendererInterface $renderer)
public function __construct(FormRendererInterface $renderer)
{
$this->renderer = $renderer;
}
Expand Down

0 comments on commit ebc160a

Please sign in to comment.