-
Notifications
You must be signed in to change notification settings - Fork 139
Added test for SonataCoreBundle #272
Added test for SonataCoreBundle #272
Conversation
} | ||
|
||
$this->fail(sprintf('Compiler pass is not one of the expected types. Expects "Sonata\AdminBundle\DependencyInjection\Compiler\StatusRendererCompilerPass", "Sonata\AdminBundle\DependencyInjection\Compiler\AdapterCompilerPass" or "Sonata\AdminBundle\DependencyInjection\Compiler\FormFactoryCompilerPass", but got "%s".', get_class($pass))); | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You SHOULD use Prophecy (SHOULD as in "the PR will not get refused it you don't, but it's better) ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, the discussion is not over: sonata-project/dev-kit#89 :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, my bad!
Excellent initiative @ahmetakbn ! |
{ | ||
/** | ||
* @group core-bundle | ||
* @covers Sonata\CoreBundle\SonataCoreBundle::build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove @covers
. We want to follow Symfony usage and they don't use it.
1a1edf0
to
832596c
Compare
d739627
to
1077b5b
Compare
The only lines not being tested are these in if (class_exists('Nelmio\ApiDocBundle\Form\Extension\DescriptionFormTypeExtension')) {
$formTypes[] = 'nelmio_api_doc.form.extension.description_form_type_extension';
} How should I mock php native functions? any suggestions? May be this: https://github.com/php-mock/php-mock |
I think |
Ok, I will add |
No need for the PR, I'll do that with styleci. Sullivan SENECHAL
|
Rebasing might be enough for that, I don't know… |
@ahmetakbn I checked StyleCI, nothing to be changed. Be sure your local 3.x branch is sync with upstream and do a rebase again. |
1077b5b
to
fb5d4d3
Compare
Ouch. I think you did a rebase from master instead of 3.x... |
|
fb5d4d3
to
f3d4aeb
Compare
f3d4aeb
to
eaac5f7
Compare
Yes I didn't realize that, sorry. Now it is rebased to 3.x |
@@ -37,7 +37,8 @@ | |||
"sensio/framework-extra-bundle": "^2.3 || ^3.0", | |||
"sonata-project/exporter": "^1.3", | |||
"symfony/phpunit-bridge": "^2.7", | |||
"sllh/php-cs-fixer-styleci-bridge": "^2.0" | |||
"sllh/php-cs-fixer-styleci-bridge": "^2.0", | |||
"nelmio/api-doc-bundle": "^2.11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing this in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, sorry
eaac5f7
to
24582ea
Compare
This PR is ready from my side. |
/** | ||
* @dataProvider getRegisteredFormMappingAndExtensions | ||
* | ||
* @param $mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Param type?
LGTM |
@ahmetakbn I removed the changelog, this is not needed just for test changes. |
24582ea
to
8f11a79
Compare
In the name of the code coverage, I thank you! 👍 |
Nice! |
Thank you @ahmetakbn kepp the good work 👍 |
Subject
Writing test to increase code coverage of
SonataCoreBundle
Todo