There is a particular PhpUnit test I am trying to run in PhpStorm that is behaving strangely. Please see the class below.
<?php
include_once('../ecoi/app/config.inc');
class formDataTest extends PHPUnit_Framework_TestCase {
public function testStateChange() {
$a = formData::calcCoiState(1);
$this - > assertEquals(1, $a);
}
}
The bottom left viewer spits out a "Test Framework quit unexpectedly" error but the console output directly to the right has a "OK (1 test, 1 assertion) ..." message which I've come to interpret as a success. Now this is where it gets weird(er).
Modifying the "assertEquals" arguments from "1" to "2" will effectively fail the test and both the left and right panes function as expected. It's clearly logged as a successful failure, so to speak.
I have a "MoneyTest" class that will pass and fail gracefully (to rule out that there's a blanket bug with the "passing" of a test.
include_once('selenium/Money.php');
class MoneyTest extends PHPUnit_Framework_TestCase {
// ...
public function testCanBeNegated()
{
// Arrange
$a = new Money(1);
// Act
$b = $a->negate();
// Assert
$this->assertEquals(1, $b->getAmount());
}
// ...
}
The issue seems to have something to do with the class it's trying to reference. I'm just not sure why the fail registers appropriately, but the pass is only partially registered. Any advice would help, and I'd be happy to provide additional info.