On Wed, 16 Apr 2008 21:26:50 -0400
"Edward Z. Yang" <edwardzyang thewritingpot.com> wrote:
> If the behavior is as you describe it, this is most
certainly a bug
> with SimpleTest's mocking facilities. It's rather
difficult to mock
> static interfaces without LSB (late static binding),
which is only
> going to be around PHP 5.3, so this code shouldn't be
generated at
> all.
Maybe a user-friendly error ought to be generated if someone
does try
to mock a class with one or more static methods.
FYI, the test:
function testCanDumpFile() {
$this->test_case->createFile('foo', 'hello
world');
$dumper = new MockSimpleDumper;
$this->reporter->setReturnReference('getDumper',
$dumper);
$dumper->expectOnce('dump', array('hello
world'));
$this->test_case->dumpFile('foo');
}
The code:
class FileSystemTestCase extends UnitTestCase {
...
...
function dumpFile($path) {
$path = $this->_sandboxMask($path);
$this->dump(file_get_contents($path));
}
Noel
------------------------------------------------------------
-------------
This SF.net email is sponsored by the 2008 JavaOne(SM)
Conference
Don't miss this year's exciting event. There's still time to
save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;1987
57673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Simpletest-support mailing list
Simpletest-support lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simp
letest-support
|