? ? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
7 Mar 2018

As our code style checker does not support anonymous classes, this pr replaces the content service provider class to a real one and uses a mock in the JErrorPageTest.

avatar laoneo laoneo - open - 7 Mar 2018
avatar laoneo laoneo - change - 7 Mar 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Mar 2018
Category Administration com_content Unit Tests
avatar mbabker
mbabker - comment - 7 Mar 2018

If we're having to refactor code because the static analysis tools don't support a syntax, that seems like a problem...

avatar laoneo
laoneo - comment - 7 Mar 2018

Agree. Not sure if we want to leave drone broken for now? Any clue when we can expect anonymous class support in the CS rules?

But for the unit tests it is ok to use a mock instead of an anonymous class.

For referenece, I opened an issue in the CS repo joomla/coding-standards#231.

avatar mbabker
mbabker - comment - 7 Mar 2018

Aside from the doc block detection (which to be honest, part of me wants to say "screw it" because you don't do doc blocks for Closures and those are just anonymous functions, why should anonymous classes have a documentation requirement an anonymous function doesn't?), there aren't issues with anonymous classes that I've run across.

avatar wilsonge
wilsonge - comment - 8 Mar 2018

there aren't issues with anonymous classes that I've run across.

Look at the tabbing code style error in the unit tests

avatar wilsonge
wilsonge - comment - 8 Mar 2018

Mock for the tests does look better. You don't even need to mock getRenderer that was just so I could implement the interface in the anonymous class. Let's start with that. Revert the change to the component thing - that will get cleaned up with phpcs version 2 - if drone fails for now cause of that it fails for now

avatar mbabker
mbabker - comment - 8 Mar 2018

Look at the tabbing code style error in the unit tests

General tabbing issue unrelated to anonymous classes, joomla/coding-standards#230 and other items track it (though not explicitly mentioning anonymous classes)

avatar laoneo laoneo - change - 8 Mar 2018
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 8 Mar 2018
Category Administration com_content Unit Tests Unit Tests
avatar laoneo
laoneo - comment - 8 Mar 2018

Done.

avatar wilsonge wilsonge - change - 8 Mar 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-03-08 17:46:54
Closed_By wilsonge
avatar wilsonge wilsonge - close - 8 Mar 2018
avatar wilsonge wilsonge - merge - 8 Mar 2018
avatar wilsonge
wilsonge - comment - 8 Mar 2018

Thanks!

Add a Comment

Login with GitHub to post a comment