<?php

class FilesParseTest extends \PHPUnit_Framework_TestCase
{

    public function testFilesParse()
    {
        foreach ($this->getPhpFiles(DIR_BASE_CORE . "/src") as $file) {
            $this->loadFile(array_shift($file));
        }
    }

    private function getPhpFiles($path)
    {
        $directory = new RecursiveDirectoryIterator($path);
        $iterator = new RecursiveIteratorIterator($directory);
        return new RegexIterator($iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH);
    }

    private function loadFile($path)
    {
        ob_start();
        require_once $path;
        ob_end_clean();
    }

}

Add a test that ensures all /src files parse
Add a test that ensures all /src files parse

Former-commit-id: 0792beb820dd9e464b153963d8ac5040a3fa7ccd
Former-commit-id: 0df92273484d72c9fd5c379e3a2bb4cc9a193bcf