NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Using phpUnit Version 7 with nusphere PhpEd possible?


Joined: 16 Sep 2018
Posts: 1
Reply with quote
Hey everybody,

i am new to this forum, so perhaps this thread is in the wrong forum. If this is the case, i would kindly ask one of the moderators to shift it to the appropriate place.

I just ordered and installed PhpED 19034 and was kind of astonished to find a link to phpunit-6.1.3.phar under settings\external tools\Path to phpUnit package. I have expected to see phpUnit Version 7 or a recent version 6 release there, as version 7 was released already in February this year and the recent Version 6 is 6.5.13.

Which release of PhpED will support phpUnit Version 7?

Interestingly PhpED almost supports phpunit-6.5.13.phar, one has to edit phpUnitListener.php (on windows it is inside C:\Users\xxxx\AppData\Roaming\NuSphere\PhpED\unitTest) to change the following aspects:

-> the namespaces from PHPUnit_Util_Printer to PHPUnit\Util\Printer and the same for PHPUnit_Framework_Test and others)
-> add one function addWarning (copy of addFailure for example and change function arguments accordingly)
-> if there are others errors, they are self-explanatory, just try to load 6.5.13 and you will get the errors on the console window.

I can provide the phpUnitListener.php to get 6.5.13 to work, if needed.

To get phpUnit V7 to work one has to adjust the function arguments and return values and one has to rewrite the $this->write calls from passing arrays to passing strings. Especially the last aspect is quite annoying.

Best,

Malte
View user's profileFind all posts by sbmilesSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Quote:
the namespaces from PHPUnit_Util_Printer to PHPUnit\Util\Printer and the same for PHPUnit_Framework_Test and others)

https:// phpunit.de/manual/6.5/en/textui.html :
--printer
Specifies the result printer to use. The printer class must extend PHPUnit_Util_Printer and implement the PHPUnit\Framework\TestListener interface.

Perhaps docs is outdated...
I think we could make necessary changes to support 6.5 but, until I miss something, such changes would break compatibility with version we currently support - 5.7 and 6.1.
Let me know if you can get your version of the listener working with them -- in this case we'll include it in the next build of v19.

As of v7 it was released when we've already passed phase 2 of beta testing -- too late even to think about it.
and again, we need to provide backward compatibility. PhpED v19 must support at least phpUnit 5.7 and 6.1.
Otherwise, this can't be added before next major release.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Using phpUnit Version 7 with nusphere PhpEd possible?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic