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 #7098

Simplified mocking of files and directories using Stream_Var

Details

Request #7098Simplified mocking of files and directories using Stream_Var
Submitted2006-03-12 12:01 UTC
Frommaxx dot gass at gmail dot com
StatusSuspended
PackagePHPUnit2
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-03-12 12:01 UTC] maxx dot gass at gmail dot com

Description:
------------
I recently ran over AcidTest (http://wiki.jonnay.net/bunny/acidtest) which supports mocking of files.

In PEAR there is already Stream_Var that allows using variables as files. It's not complicated but integrating it into PHPUnit2 would be nice.

Test script:
---------------
PHPUnit2_Extensions_FileMock::createDirectory('templates');
PHPUnit2_Extensions_FileMock::createFile('templates/simple.tpl', 'A simple test only');

$template = new Template('phpunit2mock://templates/simple.tpl');

$this->assertEquals($template->render(), 'A simple test only'));

PHPUnit2_Extensions_FileMock::deleteFile('templates/simple.tpl');
PHPUnit2_Extensions_FileMock::deleteDirectory('templates');

[2006-07-05 15:33 UTC] sebastian at php dot net

Moved to http://www.phpunit.de/ticket/4.