Updated to latest FuzeWorks libraries.

master 1.3.0
Abel Hoogeveen 7 months ago
parent 1938ebad55
commit 029511f0cd
Signed by: abelhooge
GPG Key ID: C540221690CBFFBA
  1. 16
      composer.json
  2. 14
      test/autoload.php
  3. 5
      test/bootstrap.php
  4. 2
      test/database/DatabaseTest.php
  5. 13
      test/database/DatabaseTestAbstract.php
  6. 43
      test/phpunit.xml

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

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

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

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

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

@ -1,34 +1,19 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
bootstrap="autoload.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
colors="false">
<?xml version="1.0"?>
<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">
<coverage processUncoveredFiles="false">
<include>
<directory suffix=".php">../</directory>
</include>
<exclude>
<directory suffix=".php">../vendor/</directory>
<directory suffix=".php">../test/</directory>
<directory suffix=".php">../src/Layout/</directory>
<directory suffix=".php">../src/Config/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="FuzeWorks Database Suite">
<testsuite name="Core Suite">
<directory>./</directory>
</testsuite>
</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>
Loading…
Cancel
Save