Updated to latest FuzeWorks libraries.

This commit is contained in:
Abel Hoogeveen 2021-11-29 22:58:24 +01:00
parent 1938ebad55
commit 029511f0cd
Signed by: abelhooge
GPG Key ID: C540221690CBFFBA
6 changed files with 36 additions and 57 deletions

View File

@ -1,27 +1,23 @@
{ {
"name": "fuzeworks/database", "name": "fuzeworks/database",
"description": "FuzeWorks Framework Database Component", "description": "FuzeWorks Framework Database Component",
"homepage": "https://techfuze.net/fuzeworks", "homepage": "https://i15.nl/fuzeworks",
"license": ["MIT"], "license": ["MIT"],
"authors": [ "authors": [
{ {
"name": "TechFuze", "name": "Abel Hoogeveen",
"homepage": "https://techfuze.net" "homepage": "https://i15.nl"
},
{
"name": "FuzeWorks Community",
"homepage": "https://techfuze.net/fuzeworks/contributors"
} }
], ],
"require": { "require": {
"php": ">=7.4.0", "php": ">=7.4.0",
"fuzeworks/core": "~1.2.6", "fuzeworks/core": "~1.3.0",
"fuzeworks/mvcr": "~1.3.1", "fuzeworks/mvcr": "~1.3.0",
"ext-pdo": "*" "ext-pdo": "*"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9", "phpunit/phpunit": "^9",
"fuzeworks/tracycomponent": "~1.2.0" "fuzeworks/tracycomponent": "~1.3.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View File

@ -31,7 +31,7 @@
* @link http://techfuze.net/fuzeworks * @link http://techfuze.net/fuzeworks
* @since Version 1.1.4 * @since Version 1.1.4
* *
* @version Version 1.1.4 * @version Version 1.3.0
*/ */
use FuzeWorks\Logger; use FuzeWorks\Logger;
@ -41,18 +41,11 @@ chdir(dirname(__DIR__));
// Load the FuzeWorks container // Load the FuzeWorks container
$container = require('bootstrap.php'); $container = require('bootstrap.php');
Logger::disableHandlers();
// Load the test abstract // Load the test abstract
require_once 'database/DatabaseTestAbstract.php'; require_once 'database/DatabaseTestAbstract.php';
// Reset error and exception handlers
ob_start();
restore_error_handler();
restore_exception_handler();
// Set logger template for output in CLI
Logger::setLoggerTemplate('logger_cli');
// Display all errors // Display all errors
ini_set('display_errors', 1); ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
@ -60,4 +53,5 @@ error_reporting(E_ALL | E_STRICT);
// Set localhost "remote" IP // Set localhost "remote" IP
isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; isset($_SERVER['REMOTE_ADDR']) OR $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
// Set logger template for output in CLI
Logger::setLoggerTemplate('logger_cli');

View File

@ -54,8 +54,5 @@ $configurator->addComponent(new DatabaseComponent());
$configurator->addComponent(new TracyComponent()); $configurator->addComponent(new TracyComponent());
// Create container // Create container
$container = $configurator->createContainer(); return $configurator->createContainer();
// And return the result
return $container;

View File

@ -51,7 +51,7 @@ class DatabaseTest extends DatabaseTestAbstract
*/ */
protected $database; protected $database;
public function setUp() public function setUp(): void
{ {
$this->database = Factory::getInstance()->database; $this->database = Factory::getInstance()->database;
} }

View File

@ -34,6 +34,7 @@
* @version Version 1.1.4 * @version Version 1.1.4
*/ */
use FuzeWorks\Config;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use FuzeWorks\Events; use FuzeWorks\Events;
use FuzeWorks\Factory; use FuzeWorks\Factory;
@ -51,15 +52,21 @@ abstract class DatabaseTestAbstract extends TestCase
* *
* Reset the layout manager * Reset the layout manager
*/ */
public function tearDown() public function tearDown(): void
{ {
// Clear all events created by tests // Clear all events created by tests
Events::$listeners = array(); Events::$listeners = [];
// Reset all config files // Reset all config files
Factory::getInstance()->config->discardConfigFiles(); Factory::getInstance('config')->discardConfigFiles();
// Re-enable events, in case they have been disabled // Re-enable events, in case they have been disabled
Events::enable(); Events::enable();
// Remove Config overrides
Config::$configOverrides = [];
// Remove autoloader
Core::clearAutoloader();
} }
} }

View File

@ -1,34 +1,19 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd" <?xml version="1.0"?>
bootstrap="autoload.php" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="autoload.php" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" colors="false">
convertErrorsToExceptions="true" <coverage processUncoveredFiles="false">
convertNoticesToExceptions="true" <include>
convertWarningsToExceptions="true" <directory suffix=".php">../</directory>
stopOnError="false" </include>
stopOnFailure="false" <exclude>
stopOnIncomplete="false" <directory suffix=".php">../vendor/</directory>
stopOnSkipped="false" <directory suffix=".php">../test/</directory>
colors="false"> <directory suffix=".php">../src/Layout/</directory>
<directory suffix=".php">../src/Config/</directory>
</exclude>
</coverage>
<testsuites> <testsuites>
<testsuite name="FuzeWorks Database Suite"> <testsuite name="Core Suite">
<directory>./</directory> <directory>./</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<logging>
<log type="json" target="../build/phpunit/logfile.json"/>
<log type="junit" target="../build/phpunit/logfile.xml"/>
<log type="testdox-html" target="../build/phpunit/testdox.html"/>
<log type="testdox-text" target="../build/phpunit/testdox.txt"/>
</logging>
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<directory suffix=".php">../</directory>
<exclude>
<directory suffix=".php">../vendor/</directory>
<directory suffix=".php">../tests/</directory>
</exclude>
</whitelist>
</filter>
</phpunit> </phpunit>