Skip to content

Testing fixes and improvements #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2014

Conversation

frne
Copy link
Contributor

@frne frne commented Nov 21, 2014

TODO

  • Reactivates WebTests
  • Reactivates / implement skipped ones
  • Adds tests for the sonata extensions
  • Fixes FrontendLinkExtension compatibility with Symfony 2.6

Part of the discussion in #275...

PR-Doc

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets maybe partially #232
License MIT
Doc PR

@dbu
Copy link
Member

dbu commented Nov 21, 2014

awesome, the tests are run and green, according to travis!

to test the extensions, lets just configure them and in the tests we already have check if they injected their bits.

oh, for the RouteReferrersExtension, this would be very complicated. we would need to create a mock document and an admin for it, just to test the tab. maybe lets only test the FrontendLink here, and for the rest see if we can add some tests in the cmf-sandbox where we actually have admins configured.

@frne
Copy link
Contributor Author

frne commented Nov 21, 2014

I thought about decoupling the extension's tests from the rest (writing a separate test case), because the FrontendLinkExtension is not an integral component of the bundle and it simplifies understanding of the tests in the future. What do you think about 75aa756 (incomplete yet)?

@dbu
Copy link
Member

dbu commented Nov 22, 2014

looks sane to me. the only reason why i would have mixed this test into the normal admin test is that if something is wrong with the admin in general, we now will have 2 tests failing. if you configure the test application to load the extension, the inverse is likely true too: if the extension is broken, the base test will also fail as the page is not loading anymore. thats why i thought of testing that bit at the end of the existing admin tests (maybe with a method like assertFrontendLinkPresent and assertFrontendLinkExtensionNotPresent to better separate it).

@frne
Copy link
Contributor Author

frne commented Nov 22, 2014

Extending the existing tests seems the better variant. Changed code accordingly...

I also did some improvement on the Extension itself to ensure compatibility with Symfony 2.6

@frne
Copy link
Contributor Author

frne commented Nov 24, 2014

Is here anything left to do?
Maybe we could resolve #232 but I don't get what's exactly the need of the PR.

/cc @dbu @ElectricMaxxx

* @param string $action
* @param AdminInterface $childAdmin
* @return mixed|void
* @throws \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cs: please have an empty line between param and return and between return and throws.

actually, please either explain the parameters or do not add a phpdoc - as is, everything except throws can be seen in the method signature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the @throws should stay either way. we rely on the use statement so it should just be the local class name of the exception without path

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a public method I would say that at least a minimal description of the method should be required. and I would always document the parameters and returns even without descriptions - if we add docblocks to methods then they should be complete imo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just hate @param string $action The action style comments. rather really miss them so its visible. but indeed it would make a lot of sense to explain for example what that string means and what it may be.

oh, or as this actually is implementing an interface method, the right thing would be {@inheritDoc} first and then whatever specific doc we have for this class ("Adds a tab linking to this document in the frontend.")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah of course if this is an interface method then we happily just use {@inheritDoc} :)

@dbu
Copy link
Member

dbu commented Nov 24, 2014

excellent! can you cleanup the CS issues and squash the commits.

i totally forgot about #232 - i think most of 232 will be resolved by what you do here.

@frne frne force-pushed the sonata-extension-testing branch from 1fe70dd to 18ad220 Compare November 24, 2014 14:26
@frne frne force-pushed the sonata-extension-testing branch from 18ad220 to ff2c76a Compare November 24, 2014 14:32
@frne
Copy link
Contributor Author

frne commented Nov 24, 2014

done.

@dbu dbu changed the title [WIP] Testing fixes and improvements Testing fixes and improvements Nov 24, 2014
dbu added a commit that referenced this pull request Nov 24, 2014
@dbu dbu merged commit 330c3ac into symfony-cmf:master Nov 24, 2014
@dbu
Copy link
Member

dbu commented Nov 24, 2014

awesome, thanks a lot!

@frne frne deleted the sonata-extension-testing branch November 25, 2014 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants