hardayal / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

HasToString matcher's mismatch description is empty #181

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When the object doesn't implement the magic __toString() method, the mismatch 
description is empty. However, featureValueOf() doesn't check for __toString().

1. Should the matcher allow matching on PHP's built-in result of the object's 
class name?

2. If not, featureValueOf() should check for __toString(), and 
matchesSafelyWithDiagnosticDescription() should add a message such as "object 
has no toString() method" in that case.

Original issue reported on code.google.com by dharkn...@gmail.com on 24 Apr 2012 at 6:05