PHP Classes

File: Tests/AbstractTestCase.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Simple PHP Memory Database   Tests/AbstractTestCase.php   Download  
File: Tests/AbstractTestCase.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Simple PHP Memory Database
Manipulate databases stored in JSON format files
Author: By
Last change: fixing CS & MD
Date: 7 years ago
Size: 492 bytes
 

Contents

Class file image Download
<?php

namespace JLaso\SimpleMemoryDb\Tests;

abstract class
AbstractTestCase extends \PHPUnit_Framework_TestCase
{
   
/** @var string */
   
protected $tmpFile;

    protected function
setUp()
    {
       
$this->tmpFile = __DIR__.'/tmp.json';
       
$this->cleanTmp();
    }

    protected function
tearDown()
    {
       
$this->cleanTmp();
    }

    protected function
cleanTmp()
    {
        if (
file_exists($this->tmpFile)) {
           
unlink($this->tmpFile);
        }
    }
}