This repository was archived by the owner on Nov 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,15 +125,9 @@ Injector interface.
125125Injects just before ` </body> ` tag.
126126
127127### Test helper
128- ???
128+ - ` Cethyworks\ContentInjectorBundle\Test\InjectorTypeTestCase `
129+
130+ Extends ` TypeTestCase ` and initialize the ` InjectorAwareTypeExtension ` extension.
129131
130132### todo
131133- Custom ` @inject ` annotation (?)
132-
133-
134- ### Test Helpers
135- #### ` FormViewAwareInjectorTypeTestCaseHelper `
136- Provides some shortcuts to test ` AbstractFormViewAwareInjectorType ` formTypes.
137-
138- #### ` FormViewAwareInjectorTypeTestCase `
139- Is a base class to test ` AbstractFormViewAwareInjectorType ` formTypes.
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Cethyworks \ContentInjectorBundle \Command \Factory ;
3+ namespace Cethyworks \ContentInjectorBundle \Command \Factory ;
44
5- use Cethyworks \ContentInjectorBundle \Command \TwigCommand ;
6- use Symfony \Component \Form \FormView ;
7- use Twig_Environment ;
5+ use Cethyworks \ContentInjectorBundle \Command \TwigCommand ;
6+ use Symfony \Component \Form \FormView ;
7+ use Twig_Environment ;
88
9- class TwigFormCommandFactory implements FormCommandFactoryInterface
9+ class TwigFormCommandFactory implements FormCommandFactoryInterface
1010{
1111 /**
1212 * @var Twig_Environment
Original file line number Diff line number Diff line change 66use Cethyworks \ContentInjectorBundle \EventSubscriber \ContentInjectorSubscriber ;
77use Cethyworks \ContentInjectorBundle \Form \Extension \InjectorAwareTypeExtension ;
88use Symfony \Component \Form \FormExtensionInterface ;
9+ use Symfony \Component \Form \FormTypeExtensionInterface ;
910use Symfony \Component \Form \Test \TypeTestCase ;
1011
1112/**
1213 * @codeCoverageIgnore
1314 */
1415class InjectorTypeTestCase extends TypeTestCase
1516{
17+ /** @var \PHPUnit_Framework_MockObject_MockObject|FormCommandFactoryInterface */
1618 protected $ commandFactory ;
1719
20+ /** @var \PHPUnit_Framework_MockObject_MockObject|ContentInjectorSubscriber */
1821 protected $ subscriber ;
1922
2023 public function setUp ()
@@ -26,9 +29,9 @@ public function setUp()
2629 }
2730
2831 /**
29- * @return FormExtensionInterface []
32+ * @return FormTypeExtensionInterface []
3033 */
31- protected function getExtensions ()
34+ protected function getTypeExtensions ()
3235 {
3336 return [
3437 new InjectorAwareTypeExtension ($ this ->commandFactory , $ this ->subscriber ),
Original file line number Diff line number Diff line change @@ -83,18 +83,12 @@ public function testBuildViewShouldRegisterInjector()
8383 $ this ->extension ->buildView ($ view , $ form , $ options );
8484 }
8585
86-
87- /**
88- * Configure & add listener on the dispatcher
89- *
90- * @param FormView $view
91- */
86+
9287 protected function setUp ()
9388 {
9489 $ this ->commandFactory = $ this ->getMockBuilder (FormCommandFactoryInterface::class)->disableOriginalConstructor ()->getMock ();
9590 $ this ->subscriber = $ this ->getMockBuilder (ContentInjectorSubscriber::class)->disableOriginalConstructor ()->getMock ();
9691
9792 $ this ->extension = new InjectorAwareTypeExtension ($ this ->commandFactory , $ this ->subscriber );
98-
9993 }
10094}
You can’t perform that action at this time.
0 commit comments