PHP Classes

File: Build/UnitTestsBootstrap.php

Recommend this page to a friend!
  Classes of FN   PHP Base Converter   Build/UnitTestsBootstrap.php   Download  
File: Build/UnitTestsBootstrap.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Base Converter
Convert number representations between two bases
Author: By
Last change:
Date: 6 years ago
Size: 1,099 bytes
 

Contents

Class file image Download
<?php
/**
 * BaseConverter.
 *
 * @author Frank Nägler <mail@naegler.net>
 *
 * @link https://github.com/NeoBlack/BaseConverter
 */
class UnitTestsBootstrap
{
   
/**
     * Bootstraps the system for unit tests.
     */
   
public function bootstrapSystem()
    {
       
$this->enableDisplayErrors()
            ->
initializeConfiguration();
    }

   
/**
     * Makes sure error messages during the tests get displayed no matter what is set in php.ini.
     *
     * @return UnitTestsBootstrap fluent interface
     */
   
protected function enableDisplayErrors()
    {
        @
ini_set('display_errors', 1);

        return
$this;
    }

   
/**
     * Provides the default configuration.
     *
     * @return UnitTestsBootstrap fluent interface
     */
   
protected function initializeConfiguration()
    {
        include
__DIR__.'/../vendor/autoload.php';

        return
$this;
    }
}

if (
PHP_SAPI !== 'cli') {
    die(
'This script supports command line usage only. Please check your command.');
}
$bootstrap = new UnitTestsBootstrap();
$bootstrap->bootstrapSystem();
unset(
$bootstrap);