Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rebranded as SimpleThings bundle

  • Loading branch information...
commit b0bb9933d8e4976d54b6b1d89ac8791ef4dbb3ad 1 parent 2b13c4d
@henrikbjorn henrikbjorn authored
Showing with 151 additions and 144 deletions.
  1. +2 −2 DependencyInjection/Compiler/TwigFormPass.php
  2. +2 −2 DependencyInjection/Configuration.php
  3. +9 −4 DependencyInjection/{ComwaysFormExtraExtension.php → SimpleThingsFormExtraExtension.php}
  4. +2 −2 Form/DataTransformer/FileSetTransformer.php
  5. +1 −1  Form/DataTransformer/HtmlEntitiesTransformer.php
  6. +2 −2 Form/DataTransformer/RecaptchaTransformer.php
  7. +1 −1  Form/DataTransformer/StripTagsTransformer.php
  8. +1 −1  Form/Extension/FieldTypeExtension.php
  9. +3 −3 Form/Type/FileSetType.php
  10. +2 −2 Form/Type/ImageType.php
  11. +1 −1  Form/Type/PlainType.php
  12. +3 −3 Form/Type/RecaptchaType.php
  13. +4 −2 FunctionalTest/Recaptcha.php
  14. +8 −8 README.md
  15. +13 −13 Resources/config/form_extra.xml
  16. +1 −1  Service/Recaptcha.php
  17. +3 −3 ComwaysFormExtraBundle.php → SimpleThingsFormExtraBundle.php
  18. +0 −22 Tests/ComwaysFormExtraBundleTest.php
  19. +3 −3 Tests/DependencyInjection/Compiler/TwigFormPassTest.php
  20. +0 −47 Tests/DependencyInjection/ComwaysFormExtraExtensionTest.php
  21. +47 −0 Tests/DependencyInjection/SimpleThingsFormExtraExtensionTest.php
  22. +2 −2 Tests/Form/DataTransformer/HtmlEntitesTransformerTest.php
  23. +3 −3 Tests/Form/DataTransformer/RecaptchaTransformerTest.php
  24. +2 −2 Tests/Form/DataTransformer/StripTagsTransformerTest.php
  25. +2 −2 Tests/Form/Extension/FieldTypeExtensionTest.php
  26. +2 −2 Tests/Form/Type/ImageTypeTest.php
  27. +2 −2 Tests/Form/Type/PlainTypeTest.php
  28. +4 −4 Tests/Form/Type/RecaptchaTypeTest.php
  29. +2 −2 Tests/FunctionalTest/RecaptchaTest.php
  30. +22 −0 Tests/SimpleThingsFormExtraBundleTest.php
  31. +1 −1  Tests/bootstrap.php
  32. +1 −1  phpunit.xml.dist
View
4 DependencyInjection/Compiler/TwigFormPass.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\DependencyInjection\Compiler;
+namespace SimpleThings\FormExtraBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -20,7 +20,7 @@ public function process(ContainerBuilder $container)
$container->setParameter('twig.form.resources', array_merge(
$container->getParameter('twig.form.resources'),
- array('ComwaysFormExtraBundle:Form:div_layout.html.twig')
+ array('SimpleThingsFormExtraBundle:Form:div_layout.html.twig')
));
}
}
View
4 DependencyInjection/Configuration.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\DependencyInjection;
+namespace SimpleThings\FormExtraBundle\DependencyInjection;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
@@ -11,7 +11,7 @@ public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
- return $builder->root('comways_form_extra')
+ return $builder->root('simple_things_form_extra')
->children()
->arrayNode('recaptcha')
->children()
View
13 ...cyInjection/ComwaysFormExtraExtension.php → ...ection/SimpleThingsFormExtraExtension.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\DependencyInjection;
+namespace SimpleThings\FormExtraBundle\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -8,7 +8,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Definition\Processor;
-class ComwaysFormExtraExtension extends Extension
+class SimpleThingsFormExtraExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
@@ -18,8 +18,13 @@ public function load(array $configs, ContainerBuilder $container)
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), $configs);
- $container->getDefinition('comways_form_extra.service.recaptcha')->replaceArgument(1, $config['recaptcha']['private_key']);
- $container->getDefinition('comways_form_extra.form.type.recaptcha')->replaceArgument(1, $config['recaptcha']['public_key']);
+ $container->getDefinition('simple_things_form_extra.service.recaptcha')->replaceArgument(1, $config['recaptcha']['private_key']);
+ $container->getDefinition('simple_things_form_extra.form.type.recaptcha')->replaceArgument(1, $config['recaptcha']['public_key']);
+ }
+
+ public function getAlias()
+ {
+ return 'simple_things';
}
}
View
4 Form/DataTransformer/FileSetTransformer.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Form\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
@@ -20,4 +20,4 @@ public function transform($value)
{
return "";
}
-}
+}
View
2  Form/DataTransformer/HtmlEntitiesTransformer.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Form\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
View
4 Form/DataTransformer/RecaptchaTransformer.php
@@ -1,12 +1,12 @@
<?php
-namespace Comways\FormExtraBundle\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Form\DataTransformer;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\DataTransformerInterface;
-use Comways\FormExtraBundle\Service\Recaptcha;
+use SimpleThings\FormExtraBundle\Service\Recaptcha;
/**
* Transforms the request into the right fields for validating the
View
2  Form/DataTransformer/StripTagsTransformer.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Form\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
View
2  Form/Extension/FieldTypeExtension.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\Extension;
+namespace SimpleThings\FormExtraBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormInterface;
View
6 Form/Type/FileSetType.php
@@ -1,13 +1,13 @@
<?php
-namespace Comways\FormExtraBundle\Form\Type;
+namespace SimpleThings\FormExtraBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
-use Comways\FormExtraBundle\Form\DataTransformer\FileSetTransformer;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
+use SimpleThings\FormExtraBundle\Form\DataTransformer\FileSetTransformer;
/**
* Extends the File type not to handle a single file, but allowing to incrementally add one more file to a set.
@@ -65,4 +65,4 @@ public function getParent(array $options)
{
return 'file';
}
-}
+}
View
4 Form/Type/ImageType.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\Type;
+namespace SimpleThings\FormExtraBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
@@ -105,4 +105,4 @@ public function getName()
{
return 'image';
}
-}
+}
View
2  Form/Type/PlainType.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\Type;
+namespace SimpleThings\FormExtraBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
View
6 Form/Type/RecaptchaType.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Form\Type;
+namespace SimpleThings\FormExtraBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
@@ -8,8 +8,8 @@
use Symfony\Component\Form\FormView;
use Symfony\Component\HttpFoundation\Request;
-use Comways\FormExtraBundle\Service\Recaptcha;
-use Comways\FormExtraBundle\Form\DataTransformer\RecaptchaTransformer;
+use SimpleThings\FormExtraBundle\Service\Recaptcha;
+use SimpleThings\FormExtraBundle\Form\DataTransformer\RecaptchaTransformer;
/**
* A ReCaptcha type for use with Google ReCatpcha services. It embeds two fields that are used
View
6 FunctionalTest/Recaptcha.php
@@ -1,6 +1,8 @@
<?php
-namespace Comways\FormExtraBundle\FunctionalTest;
+namespace SimpleThings\FormExtraBundle\FunctionalTest;
+
+use SimpleThings\FormExtraBundle\Service\Recaptcha as BaseRecaptcha;
/**
* A Recaptcha Service class that always returns true.
@@ -8,7 +10,7 @@
*
* @author Henrik Bjornskov <henrik@bjrnskov.dk>
*/
-class Recaptcha extends \Comways\FormExtraBundle\Service\Recaptcha
+class Recaptcha extends BaseRecaptcha
{
/**
* @param string $challenge
View
16 README.md
@@ -1,4 +1,4 @@
-ComwaysFormExtraBundle
+SimpleThingsFormExtraBundle
----------------------
This bundle contains additional functionality for Symfony2's Form Component.
@@ -19,7 +19,7 @@ Contributors
============
Thanks to all who have helped make this bundle awesome. For a list of people who have helped you
-should visit this page: https://github.com/Comways/ComwaysFormExtraBundle/contributors.
+should visit this page: https://github.com/SimpleThings/SimpleThingsFormExtraBundle/contributors.
Contributing
============
@@ -33,11 +33,11 @@ Fire up a terminal and either clone this repository or add it as a submodule bot
by example.
``` shell
-$ git clone git://github.com/Comways/ComwaysFormExtraBundle.git vendor/bundles/Comways/FormExtraBundle
+$ git clone git://github.com/SimpleThings/SimpleThingsFormExtraBundle.git vendor/bundles/SimpleThings/FormExtraBundle
```
``` shell
-$ git submodule add git://github.com/Comways/ComwaysFormExtraBundle.git vendor/bundles/Comways/FormExtraBundle
+$ git submodule add git://github.com/SimpleThings/SimpleThingsFormExtraBundle.git vendor/bundles/SimpleThings/FormExtraBundle
```
the enable to the bundle inside your kernel class normally called `AppKernel.php`
@@ -48,7 +48,7 @@ the enable to the bundle inside your kernel class normally called `AppKernel.php
public function registerBundles()
{
// ...
- new Comways\FormExtraBundle\ComwaysFormExtraBundle(),
+ new SimpleThings\FormExtraBundle\SimpleThingsFormExtraBundle(),
// ...
}
```
@@ -67,20 +67,20 @@ $builder->add('recaptcha', 'recaptcha');
``` yaml
# app/config/config.yml
-comways_form_extra:
+simple_things_form_extra:
recaptcha:
private_key: "your-private-key"
public_key: "your-public-key"
```
When doing functional testing it is not possible to use the real Google Recaptcha API therefor there is
-a `Comways\FormExtraBundle\FunctionalTest\Recaptcha` which always returns true.
+a `SimpleThings\FormExtraBundle\FunctionalTest\Recaptcha` which always returns true.
It can be used by overwriting the DependencyInjection parameter in app/config/config_test.yml
``` yaml
parameters:
- comways_form_extra.service.recaptcha.class: Comways\FormExtraBundle\FunctionalTest\Recaptcha
+ simple_things_form_extra.service.recaptcha.class: SimpleThings\FormExtraBundle\FunctionalTest\Recaptcha
```
## PlainType
View
26 Resources/config/form_extra.xml
@@ -5,39 +5,39 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
- <parameter key="comways_form_extra.form.type.recaptcha.class">Comways\FormExtraBundle\Form\Type\RecaptchaType</parameter>
- <parameter key="comways_form_extra.form.type.image.class">Comways\FormExtraBundle\Form\Type\ImageType</parameter>
- <parameter key="comways_form_extra.form.type.plain.class">Comways\FormExtraBundle\Form\Type\PlainType</parameter>
- <parameter key="comways_form_extra.form.type.file_set.class">Comways\FormExtraBundle\Form\Type\FileSetType</parameter>
- <parameter key="comways_form_extra.form.extension.field.class">Comways\FormExtraBundle\Form\Extension\FieldTypeExtension</parameter>
- <parameter key="comways_form_extra.service.recaptcha.class">Comways\FormExtraBundle\Service\Recaptcha</parameter>
+ <parameter key="simple_things_form_extra.form.type.recaptcha.class">SimpleThings\FormExtraBundle\Form\Type\RecaptchaType</parameter>
+ <parameter key="simple_things_form_extra.form.type.image.class">SimpleThings\FormExtraBundle\Form\Type\ImageType</parameter>
+ <parameter key="simple_things_form_extra.form.type.plain.class">SimpleThings\FormExtraBundle\Form\Type\PlainType</parameter>
+ <parameter key="simple_things_form_extra.form.type.file_set.class">SimpleThings\FormExtraBundle\Form\Type\FileSetType</parameter>
+ <parameter key="simple_things_form_extra.form.extension.field.class">SimpleThings\FormExtraBundle\Form\Extension\FieldTypeExtension</parameter>
+ <parameter key="simple_things_form_extra.service.recaptcha.class">SimpleThings\FormExtraBundle\Service\Recaptcha</parameter>
</parameters>
<services>
- <service id="comways_form_extra.service.recaptcha" class="%comways_form_extra.service.recaptcha.class%" scope="request">
+ <service id="simple_things_form_extra.service.recaptcha" class="%simple_things_form_extra.service.recaptcha.class%" scope="request">
<argument type="service" id="request" />
<argument />
</service>
- <service id="comways_form_extra.form.type.recaptcha" class="%comways_form_extra.form.type.recaptcha.class%" scope="request">
+ <service id="simple_things_form_extra.form.type.recaptcha" class="%simple_things_form_extra.form.type.recaptcha.class%" scope="request">
<tag name="form.type" alias="recaptcha" />
- <argument type="service" id="comways_form_extra.service.recaptcha" />
+ <argument type="service" id="simple_things_form_extra.service.recaptcha" />
<argument />
</service>
- <service id="comways_form_extra.form.type.plain" class="%comways_form_extra.form.type.plain.class%">
+ <service id="simple_things_form_extra.form.type.plain" class="%simple_things_form_extra.form.type.plain.class%">
<tag name="form.type" alias="plain" />
</service>
- <service id="comways_form_extra.form.type.image" class="%comways_form_extra.form.type.image.class%">
+ <service id="simple_things_form_extra.form.type.image" class="%simple_things_form_extra.form.type.image.class%">
<tag name="form.type" alias="image" />
</service>
- <service id="comways_form_extra.form.type.file_set" class="%comways_form_extra.form.type.file_set.class%" scope="request">
+ <service id="simple_things_form_extra.form.type.file_set" class="%simple_things_form_extra.form.type.file_set.class%" scope="request">
<tag name="form.type" alias="file_set" />
</service>
- <service id="comways_form_extra.form.extension.field" class="%comways_form_extra.form.extension.field.class%">
+ <service id="simple_things_form_extra.form.extension.field" class="%simple_things_form_extra.form.extension.field.class%">
<tag name="form.type_extension" alias="field" />
</service>
</services>
View
2  Service/Recaptcha.php
@@ -1,6 +1,6 @@
<?php
-namespace Comways\FormExtraBundle\Service;
+namespace SimpleThings\FormExtraBundle\Service;
use Symfony\Component\HttpFoundation\Request;
View
6 ComwaysFormExtraBundle.php → SimpleThingsFormExtraBundle.php
@@ -1,12 +1,12 @@
<?php
-namespace Comways\FormExtraBundle;
+namespace SimpleThings\FormExtraBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Comways\FormExtraBundle\DependencyInjection\Compiler\TwigFormPass;
+use SimpleThings\FormExtraBundle\DependencyInjection\Compiler\TwigFormPass;
-class ComwaysFormExtraBundle extends Bundle
+class SimpleThingsFormExtraBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
View
22 Tests/ComwaysFormExtraBundleTest.php
@@ -1,22 +0,0 @@
-<?php
-
-namespace Comways\FormExtraBundle\Tests;
-
-use Comways\FormExtraBundle\ComwaysFormExtraBundle;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-
-class ComwaysFormExtraBundleTest extends \PHPUnit_Framework_TestCase
-{
- public function testBuild()
- {
- $container = new ContainerBuilder();
- $bundle = new ComwaysFormExtraBundle();
-
- $bundle->build($container);
-
- $passes = $container->getCompilerPassConfig()->getBeforeOptimizationPasses();
-
- $this->assertEquals(1, count($passes));
- $this->assertInstanceOf('Comways\FormExtraBundle\DependencyInjection\Compiler\TwigFormPass', $passes[0]);
- }
-}
View
6 Tests/DependencyInjection/Compiler/TwigFormPassTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Comways\FormExtraBundle\DependencyInjection\Compiler;
+namespace SimpleThings\FormExtraBundle\DependencyInjection\Compiler;
-use Comways\FormExtraBundle\DependencyInjection\Compiler\TwigFormPass;
+use SimpleThings\FormExtraBundle\DependencyInjection\Compiler\TwigFormPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class TwigFormPassTest extends \PHPUnit_Framework_TestCase
@@ -21,7 +21,7 @@ public function testProcess()
$pass->process($container);
$this->assertEquals(array(
- 'ComwaysFormExtraBundle:Form:div_layout.html.twig',
+ 'SimpleThingsFormExtraBundle:Form:div_layout.html.twig',
), $container->getParameter('twig.form.resources'));
}
}
View
47 Tests/DependencyInjection/ComwaysFormExtraExtensionTest.php
@@ -1,47 +0,0 @@
-<?php
-
-namespace Comways\FormExtraBundle\Tests\DependencyInjection;
-
-use Comways\FormExtraBundle\DependencyInjection\ComwaysFormExtraExtension;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-
-class ComwaysFormExtraExtensionTest extends \PHPUnit_Framework_TestCase
-{
- public function testLoad()
- {
- $container = new ContainerBuilder();
- $extension = new ComwaysFormExtraExtension();
- $extension->load(array(array(
- 'recaptcha' => array(
- 'private_key' => 'my_private_key',
- 'public_key' => 'my_public_key',
- ),
- )), $container);
-
- $parameters = array(
- 'form.type.recaptcha.class' => 'Comways\FormExtraBundle\Form\Type\RecaptchaType',
- 'form.type.image.class' => 'Comways\FormExtraBundle\Form\Type\ImageType',
- 'form.type.file_set.class' => 'Comways\FormExtraBundle\Form\Type\FileSetType',
- 'form.type.plain.class' => 'Comways\FormExtraBundle\Form\Type\PlainType',
- 'form.extension.field.class' => 'Comways\FormExtraBundle\Form\Extension\FieldTypeExtension',
- 'service.recaptcha.class' => 'Comways\FormExtraBundle\Service\Recaptcha',
- );
-
- foreach ($parameters as $parameter => $value) {
- $this->assertEquals($container->getParameter('comways_form_extra.' . $parameter), $value);
- }
-
- $definitions = array(
- 'form.type.recaptcha',
- 'form.type.image',
- 'form.type.file_set',
- 'form.type.plain',
- 'form.extension.field',
- 'service.recaptcha',
- );
-
- foreach ($definitions as $definition) {
- $this->assertTrue($container->hasDefinition('comways_form_extra.' . $definition));
- }
- }
-}
View
47 Tests/DependencyInjection/SimpleThingsFormExtraExtensionTest.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace SimpleThings\FormExtraBundle\Tests\DependencyInjection;
+
+use SimpleThings\FormExtraBundle\DependencyInjection\SimpleThingsFormExtraExtension;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+class SimpleThingsFormExtraExtensionTest extends \PHPUnit_Framework_TestCase
+{
+ public function testLoad()
+ {
+ $container = new ContainerBuilder();
+ $extension = new SimpleThingsFormExtraExtension();
+ $extension->load(array(array(
+ 'recaptcha' => array(
+ 'private_key' => 'my_private_key',
+ 'public_key' => 'my_public_key',
+ ),
+ )), $container);
+
+ $parameters = array(
+ 'form.type.recaptcha.class' => 'SimpleThings\FormExtraBundle\Form\Type\RecaptchaType',
+ 'form.type.image.class' => 'SimpleThings\FormExtraBundle\Form\Type\ImageType',
+ 'form.type.file_set.class' => 'SimpleThings\FormExtraBundle\Form\Type\FileSetType',
+ 'form.type.plain.class' => 'SimpleThings\FormExtraBundle\Form\Type\PlainType',
+ 'form.extension.field.class' => 'SimpleThings\FormExtraBundle\Form\Extension\FieldTypeExtension',
+ 'service.recaptcha.class' => 'SimpleThings\FormExtraBundle\Service\Recaptcha',
+ );
+
+ foreach ($parameters as $parameter => $value) {
+ $this->assertEquals($container->getParameter('simple_things_form_extra.' . $parameter), $value);
+ }
+
+ $definitions = array(
+ 'form.type.recaptcha',
+ 'form.type.image',
+ 'form.type.file_set',
+ 'form.type.plain',
+ 'form.extension.field',
+ 'service.recaptcha',
+ );
+
+ foreach ($definitions as $definition) {
+ $this->assertTrue($container->hasDefinition('simple_things_form_extra.' . $definition));
+ }
+ }
+}
View
4 Tests/Form/DataTransformer/HtmlEntitesTransformerTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Tests\Form\DataTransformer;
-use Comways\FormExtraBundle\Form\DataTransformer\HtmlEntitiesTransformer;
+use SimpleThings\FormExtraBundle\Form\DataTransformer\HtmlEntitiesTransformer;
class HtmlEntitiesTransformersTest extends \PHPUnit_Framework_TestCase
{
View
6 Tests/Form/DataTransformer/RecaptchaTransformerTest.php
@@ -1,9 +1,9 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Tests\Form\DataTransformer;
use Symfony\Component\HttpFoundation\Request;
-use Comways\FormExtraBundle\Form\DataTransformer\RecaptchaTransformer;
+use SimpleThings\FormExtraBundle\Form\DataTransformer\RecaptchaTransformer;
class RecaptchaTransformerTest extends \PHPUnit_Framework_TestCase
{
@@ -52,7 +52,7 @@ public function testReverseTransformReturnsArrayWhenValid()
protected function getRecaptchaMock()
{
- return $this->getMock('Comways\FormExtraBundle\Service\Recaptcha', array(
+ return $this->getMock('SimpleThings\FormExtraBundle\Service\Recaptcha', array(
'isValid'
), array(new Request(), 'my-public-key'));
}
View
4 Tests/Form/DataTransformer/StripTagsTransformerTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\DataTransformer;
+namespace SimpleThings\FormExtraBundle\Tests\Form\DataTransformer;
-use Comways\FormExtraBundle\Form\DataTransformer\StripTagsTransformer;
+use SimpleThings\FormExtraBundle\Form\DataTransformer\StripTagsTransformer;
class StripTagsTransformerTest extends \PHPUnit_Framework_TestCase
{
View
4 Tests/Form/Extension/FieldTypeExtensionTest.php
@@ -1,10 +1,10 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\Extension;
+namespace SimpleThings\FormExtraBundle\Tests\Form\Extension;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormBuilder;
-use Comways\FormExtraBundle\Form\Extension\FieldTypeExtension;
+use SimpleThings\FormExtraBundle\Form\Extension\FieldTypeExtension;
class FieldTypeExtensionTest extends \PHPUnit_Framework_TestCase
{
View
4 Tests/Form/Type/ImageTypeTest.php
@@ -1,12 +1,12 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\Type;
+namespace SimpleThings\FormExtraBundle\Tests\Form\Type;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormView;
-use Comways\FormExtraBundle\Form\Type\ImageType;
use Symfony\Component\HttpFoundation\File\File;
+use SimpleThings\FormExtraBundle\Form\Type\ImageType;
class ImageFormTypeTest extends \PHPUnit_Framework_TestCase
{
View
4 Tests/Form/Type/PlainTypeTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\Type;
+namespace SimpleThings\FormExtraBundle\Tests\Form\Type;
-use Comways\FormExtraBundle\Form\Type\PlainType;
+use SimpleThings\FormExtraBundle\Form\Type\PlainType;
class PlainTypeTest extends \PHPUnit_Framework_TestCase
{
View
8 Tests/Form/Type/RecaptchaTypeTest.php
@@ -1,12 +1,12 @@
<?php
-namespace Comways\FormExtraBundle\Tests\Form\Type;
+namespace SimpleThings\FormExtraBundle\Tests\Form\Type;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormView;
-use Comways\FormExtraBundle\Form\Type\RecaptchaType;
-use Comways\FormExtraBundle\Service\Recaptcha;
+use SimpleThings\FormExtraBundle\Form\Type\RecaptchaType;
+use SimpleThings\FormExtraBundle\Service\Recaptcha;
class RecaptchaFormTypeTest extends \PHPUnit_Framework_TestCase
{
@@ -57,7 +57,7 @@ public function testBuildForm()
$transformers = $this->builder->getClientTransformers();
$this->assertEquals(1, count($transformers));
- $this->assertInstanceOf('Comways\FormExtraBundle\Form\DataTransformer\RecaptchaTransformer', $transformers[0]);
+ $this->assertInstanceOf('SimpleThings\FormExtraBundle\Form\DataTransformer\RecaptchaTransformer', $transformers[0]);
}
public function testBuildView()
View
4 Tests/FunctionalTest/RecaptchaTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Comways\FormExtraBundle\Tests\FunctionalTest;
+namespace SimpleThings\FormExtraBundle\Tests\FunctionalTest;
-use Comways\FormExtraBundle\FunctionalTest\Recaptcha;
+use SimpleThings\FormExtraBundle\FunctionalTest\Recaptcha;
use Symfony\Component\HttpFoundation\Request;
class RecaptchaTest extends \PHPUnit_Framework_TestCase
View
22 Tests/SimpleThingsFormExtraBundleTest.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace SimpleThings\FormExtraBundle\Tests;
+
+use SimpleThings\FormExtraBundle\SimpleThingsFormExtraBundle;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+class SimpleThingsFormExtraBundleTest extends \PHPUnit_Framework_TestCase
+{
+ public function testBuild()
+ {
+ $container = new ContainerBuilder();
+ $bundle = new SimpleThingsFormExtraBundle();
+
+ $bundle->build($container);
+
+ $passes = $container->getCompilerPassConfig()->getBeforeOptimizationPasses();
+
+ $this->assertEquals(1, count($passes));
+ $this->assertInstanceOf('SimpleThings\FormExtraBundle\DependencyInjection\Compiler\TwigFormPass', $passes[0]);
+ }
+}
View
2  Tests/bootstrap.php
@@ -6,7 +6,7 @@
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
- 'Comways\\FormExtraBundle' => '../../',
+ 'SimpleThings\\FormExtraBundle' => '../../',
'Symfony' => $_SERVER['SYMFONY'],
));
$loader->register();
View
2  phpunit.xml.dist
@@ -7,7 +7,7 @@
</php>
-->
<testsuites>
- <testsuite name="ComwaysFormExtraBundle">
+ <testsuite name="SimpleThingsFormExtraBundle">
<directory suffix="Test.php">./Tests</directory>
</testsuite>
</testsuites>
Please sign in to comment.
Something went wrong with that request. Please try again.