2017 © Pedro Peláez
 

library test-uploadedfile-factory

UploadedFile Factory for Testing

image

sandyandi/test-uploadedfile-factory

UploadedFile Factory for Testing

  • Wednesday, September 9, 2015
  • by sandyandi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

TestUploadedFileFactory

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

Installation

Run the following:, (*1)

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

Usage

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:, (*2)

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

Note: make sure the working directory is writeable., (*3)

Object creation

Once the factory has been instantiated, you can create an UploadedFile instance by doing the following:, (*4)

$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., (*5)

tearDown()

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

The Versions

09/09 2015

dev-master

9999999-dev

UploadedFile Factory for Testing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sandyandi N. dela Cruz

08/09 2015

1.0.4

1.0.4.0

UploadedFile Factory for Testing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sandyandi N. dela Cruz

08/09 2015

1.0.3

1.0.3.0

UploadedFile Factory for Testing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sandyandi N. dela Cruz

08/09 2015

1.0.2

1.0.2.0

UploadedFile Factory for Testing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sandyandi N. dela Cruz

07/09 2015

1.0.1

1.0.1.0

UploadedFile Factory for Testing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sandyandi N. dela Cruz