PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Testing » PHPUnit2 » Bug #4215

Error Message

Details

Request #4215Error Message
Submitted2005-04-24 10:00 UTC
Fromshaoyong at ihug dot co dot nz
StatusClosed
PackagePHPUnit2
PHP Version5.0.4
OSwinsows 2000 profession
Roadmaps(Not assigned)

Comments

[2005-04-24 10:00 UTC] shaoyong at ihug dot co dot nz

Description:
------------
This is an error message prompt bug i think. it is produces message make people confuse. example as below.

the follow script i was copy from tutorial of phpunit2, and save it to a file called unittest.php.

<?php
class BankAccount {
private $balance = 0;

public function getBalance() {
return $this->balance;
}

public function setBalance($balance) {
if ($balance >= 0) {
$this->balance = $balance;
}
}

public function depositMoney($amount) {
if (is_numeric($amount) &&
$amount >= 0) {
$this->balance += $amount;
}
}

public function withdrawMoney($amount) {
if (is_numeric($amount) &&
$amount >= 0 &&
$this->balance >= $amount) {
$this->balance -= $amount;
}
}
}

?>
I was want to use skeleton program to produce a test frame for that class.so i had typed following command in DOS window under win2000.

phpunit --skeleton bankaccout(notice: i made a mistake about spell, the corret spell should be "bankaccount") unittest.php, and the phpunit program produced following error prompt:

"Could not write test class skeleton for bankaccout to bankaccoutTest.php".

I have spent hours to check what wrong with my class,final found that i have a wrong spell.
so my suggestion is : can your make this error message more meaningful? like pop up a message say : "these is no class bankaccout in file."

I have checked source file. actully in one of file there is an error message say "can not find class", but i do not know why this message was not displayed.

regards,

Anru