I have the follwoing configuration:
- PHP 5.3.8 from xampp 1.7.7
- PHPUnit 3.7.13.
I am running my tests from both the commandline and from Netbeans on Windows XP. Here is my code.
class Wrapper
{
public function wrap($text, $maxLength) {
if(strlen($text) > $maxLength)
return substr($text, 0, $maxLength) . "\n" . substr($text, $maxLength);
return $text;
}
}
class WrapperTest extends PHPUnit_Framework_TestCase
{
protected $wrapper;
protected function setUp() {
$this->wrapper = new Wrapper;
}
public function testWrap() {
$text = '';
$this->assertEquals($text, $this->wrapper->wrap($text));
}
}
The problem is that the test passes although the function is obviously missing an argument. When using Ubuntu, the test fails as expected.