PHPackages                             sandyandi/test-uploadedfile-factory - 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. sandyandi/test-uploadedfile-factory

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

sandyandi/test-uploadedfile-factory
===================================

UploadedFile Factory for Testing

1.0.4(10y ago)016MITPHP

Since Sep 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sandyandi/test-uploadedfile-factory)[ Packagist](https://packagist.org/packages/sandyandi/test-uploadedfile-factory)[ RSS](/packages/sandyandi-test-uploadedfile-factory/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

TestUploadedFileFactory
=======================

[](#testuploadedfilefactory)

A simple Symfony\\Component\\HttpFoundation\\File\\UploadedFile factory for testing
-----------------------------------------------------------------------------------

[](#a-simple-symfonycomponenthttpfoundationfileuploadedfile-factory-for-testing)

### Installation

[](#installation)

Run the following:

```
composer require sandyandi/test-uploadedfile-factory:1.0.*

```

### Usage

[](#usage)

#### Instantiation

[](#instantiation)

```
use Sandyandi\TestUploadedFileFactory\TestUploadedFileFactory;

$testUploadedFileFactory = new TestUploadedFileFactory;
```

By default, it will use the `/tmp` directory located in `vendor/sandyandi/test-uploadedfile-factory` as its working directory. You can specify a different directory by specifying the directory path during instantiation:

```
$workDir = 'path/to/your/work/dir';
$testUploadedFileFactory = new TestUploadedFileFactory($workDir);
```

**Note:** make sure the working directory is writeable.

#### Object creation

[](#object-creation)

Once the factory has been instantiated, you can create an `UploadedFile` instance by doing the following:

```
$pathToFile = 'path/to/your/file';
$uploadedFile = $testUploadedFileFactory->create($pathTofile);
```

The factory will create a copy of your file and put it in the working directory.

#### tearDown()

[](#teardown)

Be sure to call `$testUploadedFileFactory->tearDown();` in your test's `tearDown()` method to delete all created/moved files.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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 ~0 days

Total

4

Last Release

3906d ago

### Community

Maintainers

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

---

Top Contributors

[![sandyandi](https://avatars.githubusercontent.com/u/326931?v=4)](https://github.com/sandyandi "sandyandi (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sandyandi-test-uploadedfile-factory/health.svg)

```
[![Health](https://phpackages.com/badges/sandyandi-test-uploadedfile-factory/health.svg)](https://phpackages.com/packages/sandyandi-test-uploadedfile-factory)
```

###  Alternatives

[soyuka/contexts

Behatch contexts

282.1M11](/packages/soyuka-contexts)[leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

50359.8k2](/packages/leanphp-behat-code-coverage)

PHPackages © 2026

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