Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit 576717b

Browse files
committed
Fix typos and InjectorTypeTestCase
1 parent 88b0c24 commit 576717b

4 files changed

Lines changed: 14 additions & 23 deletions

File tree

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,9 @@ Injector interface.
125125
Injects 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.

src/Command/Factory/TwigFormCommandFactory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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

src/Test/InjectorTypeTestCase.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
use Cethyworks\ContentInjectorBundle\EventSubscriber\ContentInjectorSubscriber;
77
use Cethyworks\ContentInjectorBundle\Form\Extension\InjectorAwareTypeExtension;
88
use Symfony\Component\Form\FormExtensionInterface;
9+
use Symfony\Component\Form\FormTypeExtensionInterface;
910
use Symfony\Component\Form\Test\TypeTestCase;
1011

1112
/**
1213
* @codeCoverageIgnore
1314
*/
1415
class 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),

tests/Form/Extension/InjectorAwareTypeExtensionTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)