-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from loic425/features/improve-infection
improve infection
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace spec\App\Form\Extension; | ||
|
||
use App\Form\EventSubscriber\AddUserFormSubscriber; | ||
use App\Form\Type\User\AppUserType; | ||
use PhpSpec\ObjectBehavior; | ||
use Sylius\Bundle\CustomerBundle\Form\Type\CustomerType; | ||
use Symfony\Component\Form\AbstractTypeExtension; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
|
||
class CustomerTypeExtensionSpec extends ObjectBehavior | ||
{ | ||
function it_extends_an_abstract_type_extension() | ||
{ | ||
$this->shouldHaveType(AbstractTypeExtension::class); | ||
} | ||
|
||
function it_extends_customer_type() | ||
{ | ||
$this::getExtendedTypes()->shouldReturn([CustomerType::class]); | ||
} | ||
|
||
function it_adds_user_form_subscriber(FormBuilderInterface $builder) | ||
{ | ||
$builder->addEventSubscriber(new AddUserFormSubscriber(AppUserType::class))->shouldBeCalled(); | ||
|
||
$this->buildForm($builder, []); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace spec\App\Form\Extension; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
use Symfony\Component\Form\AbstractTypeExtension; | ||
use Symfony\Component\Form\Extension\Core\Type\DateType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class DateTypeExtensionSpec extends ObjectBehavior | ||
{ | ||
function it_extends_an_abstract_type_extension() | ||
{ | ||
$this->shouldHaveType(AbstractTypeExtension::class); | ||
} | ||
|
||
function it_extends_date_type() | ||
{ | ||
$this::getExtendedTypes()->shouldReturn([DateType::class]); | ||
} | ||
|
||
function it_configures_options(OptionsResolver $resolver) | ||
{ | ||
$resolver->setDefaults(Argument::type('array'))->shouldBeCalled(); | ||
|
||
$this->configureOptions($resolver); | ||
} | ||
} |