User tests: Successful: Unsuccessful:
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
.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content Unit Tests |
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.
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.
there aren't issues with anonymous classes that I've run across.
Look at the tabbing code style error in the unit tests
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
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)
Labels |
Added:
?
?
|
Category | Administration com_content Unit Tests | ⇒ | Unit Tests |
Done.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-03-08 17:46:54 |
Closed_By | ⇒ | wilsonge |
Thanks!
If we're having to refactor code because the static analysis tools don't support a syntax, that seems like a problem...