? ? Pending

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
31 Dec 2016

This opens the unit tests to a limit amount of code style fixing. There's lot of exclusions for now, which over time we'll start to fix issues and then open them up.

For now this fails travis but going to work on fixing/excluding the remaining issues

avatar wilsonge wilsonge - open - 31 Dec 2016
avatar wilsonge wilsonge - change - 31 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Dec 2016
Category Repository Unit Tests
avatar wilsonge wilsonge - change - 31 Dec 2016
Labels Added: ? ?
avatar wilsonge
wilsonge - comment - 31 Dec 2016

@mbabker if you could look into the weird class instantiation errors?

avatar mbabker
mbabker - comment - 31 Dec 2016

If my head stops pounding this year then perhaps.

avatar wilsonge
wilsonge - comment - 31 Dec 2016

Thanks :)

avatar mbabker
mbabker - comment - 31 Dec 2016

Ping @photodude

Just at a quick glance at https://github.com/wilsonge/joomla-cms/blob/f1e50e99abd215ad44f9863c818d598aa011eaf8/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php#L91 it seems like the sniff fails to account for if the class' arguments are spread across multiple lines. You know PHPCS better than me, any ideas? (Also, does this need to be fixed in your PHPCS 2.x work?)

avatar photodude
photodude - comment - 31 Dec 2016

Off the top of my head I think multiline class instatiation should work in phpcs2.7.x I'll be out for a while today, I'll double check when I get back. The code snip you pointed to will make an easy test case to test against to check if it passes.

avatar photodude
photodude - comment - 31 Dec 2016

@mbabker I have run an isolated code test for the new class instantiation problem against the PHPCS 2.x branch of the Joomla code standard on phpcs 2.7.0 with no issues.

Looking deeper into the sniffs issue here is resulting from a failure in our phpcs1.5.x custom sniff Joomla.Classes.InstantiateNewClasses.New Off the top of my head I'm not sure if it's an issue with the phpcs1.5.x tokenizer or with our phpcs1.5.x custom sniff.

avatar photodude
photodude - comment - 2 Jan 2017

I have verified it's an issue within our phpcs1.5.x custom sniff Joomla.Classes.InstantiateNewClasses.New I have a fix from the PHPCS 2.x version.

I'll open a PR shortly to fix the issue

avatar photodude
photodude - comment - 4 Jan 2017

To be a little more specific on the class instantiation issue failure. It would occur when there were cases with the first parameter in a multiline class instantiation was an empty array array(), true, false, or null

The PR I opened for the phpcs 1.5.x sniff fixes those cases so the errors will stop. Please review that PR so we can merge.

avatar photodude
photodude - comment - 7 Jan 2017

Looks like the unit test stubs and the unit test view layouts need to be excluded (they are technically not php files after all)

and the one file tests/unit/suites/plugins/content/emailcloak/PlgContentEmailcloakTest.php has some comment issues needing to be addressed (another autofixer opportunity)

avatar wilsonge
wilsonge - comment - 8 Jan 2017

The email cloak stuff I have an existing PR for that's going to remove the comments for proper unit tests (see #13446) so no point in autofixing that

avatar photodude
photodude - comment - 8 Jan 2017

ok will consider this after #13446 is merged

avatar photodude
photodude - comment - 14 Jan 2017

@wilsonge will you merge in the staging changes?

avatar wilsonge
wilsonge - comment - 14 Jan 2017

OK We should be good to go here

avatar photodude
photodude - comment - 24 Jul 2017

@wilsonge you will need to modify the php 7 in .trusty.yml to have dist: precise since the trusty dist has mysql issues still

avatar zero-24
zero-24 - comment - 24 Jul 2017

I have just rebootet the PHP7 build.

avatar wilsonge
wilsonge - comment - 24 Jul 2017

Yay lots of passes

avatar mbabker mbabker - change - 26 Jul 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-07-26 13:35:06
Closed_By mbabker
avatar mbabker mbabker - close - 26 Jul 2017
avatar mbabker mbabker - merge - 26 Jul 2017

Add a Comment

Login with GitHub to post a comment