PHP Classes

File: tests/bootstrap.php

Recommend this page to a friend!
  Classes of Michael Cummings   PHP SQL Parser Class   tests/bootstrap.php   Download  
File: tests/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP SQL Parser Class
Parse SQL to extract the SQL query structure
Author: By
Last change:
Date: 5 years ago
Size: 526 bytes
 

Contents

Class file image Download
<?php

require_once dirname(__FILE__) . '/../vendor/autoload.php';

/**
 * Helper function for getting the expected array
 * from a file as serialized string.
 * Returns an unserialized value from the given file.
 *
 * @param String $filename
 */
function getExpectedValue($path, $filename, $unserialize = true) {
   
$path = explode(DIRECTORY_SEPARATOR, $path);
   
$content = file_get_contents(dirname(__FILE__) . "/expected/" . array_pop($path) . "/" . $filename);
    return (
$unserialize ? unserialize($content) : $content);
}
?>