Mr. X
2 years ago
"No failures". :-)

http://friendica-dev.dyndns.org/job/Friendica/95/

But I had to resort to some hackery to get there. We need a lot more tests and a review of some of the questionable ones.
5 comments show more
Alexander Kampmann
2 years ago
In your fixes, autoname($len) returns '' iff $len<=0 holds. That means, someone might think he's using a random string when he in fact failed to initialize n correctly. Maybe it is safer to generate a clean error message:

if($len <= 0) {
throw new InvalidArgumentException('autoname should not be used with parameter <= 0');
}

The same applies for some of the others.
Mr. X
2 years ago
I'm in general agreement - though with this particular example we should probably just log it and continue. Server processes in general try to keep going rather than throw exceptions and die.

And in terms of functionality, 0 could be a valid (though unusual) length. Negative isn't - so that's where I would probably throw an error.