havramar/phpunit-tmp-dir

Wrapper around VFS for easier creation temporary directory

Maintainers

Package info

github.com/havramar/phpunit-tmp-dir

pkg:composer/havramar/phpunit-tmp-dir

Statistics

Installs: 305

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2015-01-14 23:37 UTC

This package is not auto-updated.

Last update: 2020-01-06 03:41:48 UTC


README

Wrapper around vfsStream for easier creation temporary directories in PhpUnit tests.

Build Status SensioLabsInsight

Why

Needed extremely simple way of creating temporary folder, whose content is deleted when tests are finished.

How to run

  1. Get composer.
  2. composer require havramar/phpunit-tmp-dir:dev-master
  3. Create example file:
<?php

require_once 'vendor/autoload.php';

$path = \PhpunitTempDir\Helper::createTempDir();

// do whatever you want inside $path (mkdir, touch etc),
// when script exits, everything is gone as all is happening in memory