NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Incompability with PHPUnit 4.0


Joined: 17 Jan 2011
Posts: 22
Reply with quote
I have just upgraded to PHPUnit version 4.0.
All my tests run fine in console.
But same tests in PhpEd shows the following error

Quote:
PHP Fatal error: Class PhpED_phpUnitListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addRiskyTest) in C:\Users\mike\AppData\Roaming\NuSphere\PhpED\unitTest\phpUnitListener.php on line 192


It happens with any test. Even the most simple
php 5.4.25 NTS, PhpED 32bit v12.0 build 12045

Code example

Code:
class Math
{
    function add($x, $y)
    {
        return $x+$y;
    }
}

class MathTest extends \PHPUnit_Framework_TestCase
{
    function testadd()
    {
        $obj = new \Math();
        $result = $obj->add(1,2);
        $this->assertEquals(3, $result);
    }
}
View user's profileFind all posts by mikhailtSend private message


Joined: 17 Jan 2011
Posts: 22
Reply with quote
It looks like its only me who use PHPUnit with PhpEd.
Guys do you test your php code?!
Don't you have this problem?
View user's profileFind all posts by mikhailtSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
What was the reason to upgrade to 4.0?
3.7 worked fine, didn't it?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 May 2014
Posts: 1
Reply with quote
I had the same problem. I installed phpuint throught PhpED 12 Pro. This installed phpuint 4, which is not compatible with PhpED 12.

This is because of incompatibility PhpED_phpUnitListener.php with interface PHPUnit_Framework_TestListener, there was aded one method in 4th version. The solution is to add this row:

Code:
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) {}


into class definition in PhpED_phpUnitListener.php file, which is in your case located at C:\Users\mike\AppData\Roaming\NuSphere\PhpED\unitTest\phpUnitListener.php
View user's profileFind all posts by BarvajzSend private message


Joined: 22 Apr 2014
Posts: 18
Reply with quote
dmitri wrote:
What was the reason to upgrade to 4.0?
3.7 worked fine, didn't it?

Why should there be a reason not to upgrade? Wink
View user's profileFind all posts by JCISend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
JCI wrote:

Why should there be a reason not to upgrade? Wink

Have you tried?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Apr 2014
Posts: 18
Reply with quote
dmitri wrote:
Have you tried?

Not yet (lack of time). But that's not the point. Normally upgrading is a good thing, so I don't need a reason to upgrade a software. There might of course be reasons not to upgrade.

Should I be reluctant to upgrade PhpED in the future? Wink


Last edited by JCI on Mon Jun 09, 2014 5:04 am; edited 1 time in total
View user's profileFind all posts by JCISend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
JCI wrote:
But that's not the point


v13 works fine with PhpUnit4.x. That's the point.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Apr 2014
Posts: 18
Reply with quote
dmitri wrote:
v13 works fine with PhpUnit4.x. That's the point.

So why don't you just state that instead of asking for the reason for upgrading to PHPUnit 4.0? Confused Rolling Eyes

I guess I often just don't understand your way of discussing...
View user's profileFind all posts by JCISend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
mikhailt asked about v12, btw

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Apr 2014
Posts: 18
Reply with quote
dmitri wrote:
mikhailt asked about v12, btw

"Sorry for the trouble, we're working on it" would have been more helpful than "what was the reason to upgrade to 4.0" then, don't you agree? Wink

But this is getting rather off-topic.
View user's profileFind all posts by JCISend private message


Joined: 17 Jan 2011
Posts: 22
Reply with quote
dmitri wrote:
JCI wrote:
But that's not the point


v13 works fine with PhpUnit4.x. That's the point.
Thank you!

Reason to upgrade in addition to the mentioned before (it is basically a good thing)
is that upgrade happens automatically after pear upgrades.
Then my development environments must be compatible with build environments, that are always upgraded to the last versions of all PEAR packages.
View user's profileFind all posts by mikhailtSend private message
Incompability with PHPUnit 4.0
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