PHPackages                             bcncommerce/stream-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. bcncommerce/stream-wrapper

ActiveLibrary[Testing &amp; Quality](/categories/testing)

bcncommerce/stream-wrapper
==========================

PHP stream wrapper for testing classes which interact with files

1.0.1(10y ago)513.2k↑57.9%MITPHPPHP &gt;=5.3

Since Apr 9Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/skolodyazhnyy/stream-wrapper)[ Packagist](https://packagist.org/packages/bcncommerce/stream-wrapper)[ RSS](/packages/bcncommerce-stream-wrapper/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Stream Wrapper
==============

[](#stream-wrapper)

This library provide a lightweight class which allows substitute PHP streams. It's very useful for Unit Testing when you need to test a class which interact with files.

Stream class create an unique [stream wrapper](http://www.php.net/manual/en/class.streamwrapper.php) which redirect file system calls to instance of Stream class, making the process fully controllable.

Usage
-----

[](#usage)

**Reading**

```
$stream = new Stream("Content");

// This code use variable instead of using actual file
$fh = fopen($stream, "r");
echo fgets($fh); // output Content
fclose($fh);
```

**Writing**

```
$stream = new Stream();

// This code write everything into variable
$fh = fopen($stream, "r");
fputs($fh, "Content");
fclose($fh);

// Now you can perform actions on generated content
echo $stream->getContent(); // output Content
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance43

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~279 days

Total

3

Last Release

3808d ago

Major Versions

0.1.0 → 1.0.02015-07-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/b718cebb9677c634f8eff95f1da3cfc5f79469ebe4987bd0506693b18f7626dd?d=identicon)[skolodyazhnyy](/maintainers/skolodyazhnyy)

---

Top Contributors

[![skolodyazhnyy](https://avatars.githubusercontent.com/u/576301?v=4)](https://github.com/skolodyazhnyy "skolodyazhnyy (11 commits)")

---

Tags

streamphpunitfilesystemtestmockfilewrapperunit test

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bcncommerce-stream-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/bcncommerce-stream-wrapper/health.svg)](https://phpackages.com/packages/bcncommerce-stream-wrapper)
```

###  Alternatives

[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.0M356](/packages/php-mock-php-mock-phpunit)[colinodell/psr-testlogger

PSR-3 compliant test logger based on psr/log v1's, but compatible with v2 and v3 too!

1711.6M38](/packages/colinodell-psr-testlogger)[icecave/isolator

Dependency injection for global functions.

371.3M29](/packages/icecave-isolator)[elliotchance/concise

Concise is test framework for using plain English and minimal code, built on PHPUnit.

45223.6k3](/packages/elliotchance-concise)[phpcurl/curlwrapper

The simplest OOP wrapper for curl, curl\_multi, curl\_share functions. Use CURL as a dependency, not hard-coded!

11109.7k3](/packages/phpcurl-curlwrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
