Updated PHPUnit to ^9 and vfsStream to ~1.6.0.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
- This resulted in some changes needing to be made in the test folder. All tests have been updated to work with these updated dependencies. - Also, PHP 7.1 is no longer supported. - psr/log is no longer a dependency of Core
This commit is contained in:
parent
fbc17a9519
commit
3ebd91d2ef
|
@ -14,12 +14,11 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1.0",
|
"php": ">=7.2.0"
|
||||||
"psr/log": "~1.1.0"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^7",
|
"phpunit/phpunit": "^9",
|
||||||
"mikey179/vfsstream": "1.1.*"
|
"mikey179/vfsstream": "~1.6.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -31,11 +31,9 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Config;
|
|
||||||
use FuzeWorks\Core;
|
|
||||||
use FuzeWorks\Logger;
|
use FuzeWorks\Logger;
|
||||||
|
|
||||||
// First set the working directory
|
// First set the working directory
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 1.2.0
|
* @since Version 1.2.0
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
require_once(dirname(__DIR__) . '/vendor/autoload.php');
|
require_once(dirname(__DIR__) . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
@ -45,9 +45,8 @@ $configurator->setLogDirectory(__DIR__ . '/temp');
|
||||||
$configurator->setTimeZone('Europe/Amsterdam');
|
$configurator->setTimeZone('Europe/Amsterdam');
|
||||||
|
|
||||||
// Debug related
|
// Debug related
|
||||||
$configurator->enableDebugMode(true);
|
$configurator->enableDebugMode();
|
||||||
$configurator->setDebugAddress('ALL');
|
$configurator->setDebugAddress('ALL');
|
||||||
//$configurator->setDebugEmail('example@mail.com');
|
|
||||||
|
|
||||||
$container = $configurator->createContainer();
|
$container = $configurator->createContainer();
|
||||||
return $container;
|
return $container;
|
||||||
|
|
|
@ -31,14 +31,13 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use FuzeWorks\Events;
|
use FuzeWorks\Events;
|
||||||
use FuzeWorks\Factory;
|
use FuzeWorks\Factory;
|
||||||
use FuzeWorks\Core;
|
use FuzeWorks\Core;
|
||||||
use FuzeWorks\Config;
|
use FuzeWorks\Config;
|
||||||
use FuzeWorks\LoggerTracyBridge;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CoreTestAbstract.
|
* Class CoreTestAbstract.
|
||||||
|
@ -50,7 +49,7 @@ abstract class CoreTestAbstract extends TestCase
|
||||||
/**
|
/**
|
||||||
* Reset multiple components to their original state before running the next test
|
* Reset multiple components to their original state before running the next test
|
||||||
*/
|
*/
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
// Clear all events created by tests
|
// Clear all events created by tests
|
||||||
Events::$listeners = [];
|
Events::$listeners = [];
|
||||||
|
|
|
@ -31,11 +31,12 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Config;
|
use FuzeWorks\Config;
|
||||||
use FuzeWorks\Event\ConfigGetEvent;
|
use FuzeWorks\Event\ConfigGetEvent;
|
||||||
|
use FuzeWorks\Exception\ConfigException;
|
||||||
use FuzeWorks\Priority;
|
use FuzeWorks\Priority;
|
||||||
use FuzeWorks\Events;
|
use FuzeWorks\Events;
|
||||||
|
|
||||||
|
@ -53,7 +54,7 @@ class configTest extends CoreTestAbstract
|
||||||
*/
|
*/
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
$this->config = new Config();
|
$this->config = new Config();
|
||||||
}
|
}
|
||||||
|
@ -90,10 +91,10 @@ class configTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testLoadConfig
|
* @depends testLoadConfig
|
||||||
* @covers ::loadConfigFile
|
* @covers ::loadConfigFile
|
||||||
* @expectedException FuzeWorks\Exception\ConfigException
|
|
||||||
*/
|
*/
|
||||||
public function testFileNotFound()
|
public function testFileNotFound()
|
||||||
{
|
{
|
||||||
|
$this->expectException(ConfigException::class);
|
||||||
$this->config->getConfig('notFound');
|
$this->config->getConfig('notFound');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,12 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 1.2.0
|
* @since Version 1.2.0
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Configurator;
|
use FuzeWorks\Configurator;
|
||||||
use FuzeWorks\Core;
|
use FuzeWorks\Core;
|
||||||
|
use FuzeWorks\Exception\ConfiguratorException;
|
||||||
use FuzeWorks\Factory;
|
use FuzeWorks\Factory;
|
||||||
use FuzeWorks\iComponent;
|
use FuzeWorks\iComponent;
|
||||||
use FuzeWorks\Logger;
|
use FuzeWorks\Logger;
|
||||||
|
@ -54,7 +55,7 @@ class configuratorTest extends CoreTestAbstract
|
||||||
*/
|
*/
|
||||||
protected $configurator;
|
protected $configurator;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
$this->configurator = new Configurator;
|
$this->configurator = new Configurator;
|
||||||
$this->configurator->setTempDirectory(dirname(__DIR__) . '/temp');
|
$this->configurator->setTempDirectory(dirname(__DIR__) . '/temp');
|
||||||
|
@ -62,7 +63,7 @@ class configuratorTest extends CoreTestAbstract
|
||||||
$this->configurator->setTimeZone('Europe/Amsterdam');
|
$this->configurator->setTimeZone('Europe/Amsterdam');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
|
@ -132,7 +133,6 @@ class configuratorTest extends CoreTestAbstract
|
||||||
* @depends testAddComponent
|
* @depends testAddComponent
|
||||||
* @covers ::addComponent
|
* @covers ::addComponent
|
||||||
* @covers ::createContainer
|
* @covers ::createContainer
|
||||||
* @expectedException FuzeWorks\Exception\ConfiguratorException
|
|
||||||
*/
|
*/
|
||||||
public function testAddComponentFail()
|
public function testAddComponentFail()
|
||||||
{
|
{
|
||||||
|
@ -142,6 +142,7 @@ class configuratorTest extends CoreTestAbstract
|
||||||
$this->configurator->addComponent($component);
|
$this->configurator->addComponent($component);
|
||||||
|
|
||||||
// Create container and fail
|
// Create container and fail
|
||||||
|
$this->expectException(ConfiguratorException::class);
|
||||||
$this->configurator->createContainer();
|
$this->configurator->createContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,11 +176,11 @@ class configuratorTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testSetLogDirectory
|
* @depends testSetLogDirectory
|
||||||
* @covers ::setLogDirectory
|
* @covers ::setLogDirectory
|
||||||
* @expectedException \FuzeWorks\Exception\InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function testSetLogDirectoryNotDirectory()
|
public function testSetLogDirectoryNotDirectory()
|
||||||
{
|
{
|
||||||
// Set the directory
|
// Set the directory
|
||||||
|
$this->expectException(\FuzeWorks\Exception\InvalidArgumentException::class);
|
||||||
$this->configurator->setLogDirectory('not_exist');
|
$this->configurator->setLogDirectory('not_exist');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,11 +205,11 @@ class configuratorTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testSetTempDirectory
|
* @depends testSetTempDirectory
|
||||||
* @covers ::setTempDirectory
|
* @covers ::setTempDirectory
|
||||||
* @expectedException \FuzeWorks\Exception\InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function testSetTempDirectoryNotDirectory()
|
public function testSetTempDirectoryNotDirectory()
|
||||||
{
|
{
|
||||||
// Set the directory
|
// Set the directory
|
||||||
|
$this->expectException(\FuzeWorks\Exception\InvalidArgumentException::class);
|
||||||
$this->configurator->setTempDirectory('not_exist');
|
$this->configurator->setTempDirectory('not_exist');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,10 +246,10 @@ class configuratorTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testAddComponentDirectory
|
* @depends testAddComponentDirectory
|
||||||
* @covers ::addDirectory
|
* @covers ::addDirectory
|
||||||
* @expectedException \FuzeWorks\Exception\InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function testAddComponentDirectoryNotExist()
|
public function testAddComponentDirectoryNotExist()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\FuzeWorks\Exception\InvalidArgumentException::class);
|
||||||
$this->configurator->addDirectory('not_exist', 'irrelevant');
|
$this->configurator->addDirectory('not_exist', 'irrelevant');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,11 +343,11 @@ class configuratorTest extends CoreTestAbstract
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testSetTimezone
|
* @depends testSetTimezone
|
||||||
* @expectedException \FuzeWorks\Exception\InvalidArgumentException
|
|
||||||
* @covers ::setTimeZone
|
* @covers ::setTimeZone
|
||||||
*/
|
*/
|
||||||
public function testSetTimezoneInvalid()
|
public function testSetTimezoneInvalid()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\FuzeWorks\Exception\InvalidArgumentException::class);
|
||||||
$this->configurator->setTimeZone('Europe/Amsterdamned');
|
$this->configurator->setTimeZone('Europe/Amsterdamned');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,10 +473,10 @@ class configuratorTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testEnableDebugMode
|
* @depends testEnableDebugMode
|
||||||
* @covers ::setDebugAddress
|
* @covers ::setDebugAddress
|
||||||
* @expectedException \FuzeWorks\Exception\InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function testSetDebugAddressInvalidArgument()
|
public function testSetDebugAddressInvalidArgument()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\FuzeWorks\Exception\InvalidArgumentException::class);
|
||||||
$this->configurator->setDebugAddress(null);
|
$this->configurator->setDebugAddress(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,12 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Event;
|
use FuzeWorks\Event;
|
||||||
use FuzeWorks\Events;
|
use FuzeWorks\Events;
|
||||||
|
use FuzeWorks\Exception\EventException;
|
||||||
use FuzeWorks\Priority;
|
use FuzeWorks\Priority;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,21 +146,21 @@ class eventsTest extends CoreTestAbstract
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testFireEvent
|
* @depends testFireEvent
|
||||||
* @expectedException FuzeWorks\Exception\EventException
|
|
||||||
* @covers ::fireEvent
|
* @covers ::fireEvent
|
||||||
*/
|
*/
|
||||||
public function testInvalidTypeEvent()
|
public function testInvalidTypeEvent()
|
||||||
{
|
{
|
||||||
|
$this->expectException(EventException::class);
|
||||||
Events::fireEvent(array('x', 'y', 'z'));
|
Events::fireEvent(array('x', 'y', 'z'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testFireEvent
|
* @depends testFireEvent
|
||||||
* @covers ::fireEvent
|
* @covers ::fireEvent
|
||||||
* @expectedException FuzeWorks\Exception\EventException
|
|
||||||
*/
|
*/
|
||||||
public function testInvalidClassEvent()
|
public function testInvalidClassEvent()
|
||||||
{
|
{
|
||||||
|
$this->expectException(EventException::class);
|
||||||
Events::fireEvent('nonExistingEvent', 'x', 'y', 'z');
|
Events::fireEvent('nonExistingEvent', 'x', 'y', 'z');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,30 +186,30 @@ class eventsTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testAddAndRemoveListener
|
* @depends testAddAndRemoveListener
|
||||||
* @covers ::addListener
|
* @covers ::addListener
|
||||||
* @expectedException FuzeWorks\Exception\EventException
|
|
||||||
*/
|
*/
|
||||||
public function testAddInvalidPriorityListener()
|
public function testAddInvalidPriorityListener()
|
||||||
{
|
{
|
||||||
|
$this->expectException(EventException::class);
|
||||||
Events::addListener(function($event){}, 'mockEvent', 99);
|
Events::addListener(function($event){}, 'mockEvent', 99);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testAddAndRemoveListener
|
* @depends testAddAndRemoveListener
|
||||||
* @covers ::addListener
|
* @covers ::addListener
|
||||||
* @expectedException FuzeWorks\Exception\EventException
|
|
||||||
*/
|
*/
|
||||||
public function testAddInvalidNameListener()
|
public function testAddInvalidNameListener()
|
||||||
{
|
{
|
||||||
|
$this->expectException(EventException::class);
|
||||||
Events::addListener(function($e) {}, '', Priority::NORMAL);
|
Events::addListener(function($e) {}, '', Priority::NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testAddAndRemoveListener
|
* @depends testAddAndRemoveListener
|
||||||
* @covers ::removeListener
|
* @covers ::removeListener
|
||||||
* @expectedException FuzeWorks\Exception\EventException
|
|
||||||
*/
|
*/
|
||||||
public function testRemoveInvalidPriorityListener()
|
public function testRemoveInvalidPriorityListener()
|
||||||
{
|
{
|
||||||
|
$this->expectException(EventException::class);
|
||||||
Events::removeListener(function($event){}, 'mockEvent', 99);
|
Events::removeListener(function($event){}, 'mockEvent', 99);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Exception\Exception;
|
use FuzeWorks\Exception\Exception;
|
||||||
|
@ -53,83 +53,63 @@ use FuzeWorks\Exception\ConfiguratorException;
|
||||||
class exceptionTestTest extends CoreTestAbstract
|
class exceptionTestTest extends CoreTestAbstract
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\Exception
|
|
||||||
*/
|
|
||||||
public function testException()
|
public function testException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(Exception::class);
|
||||||
throw new Exception("Exception Test Run", 1);
|
throw new Exception("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\CoreException
|
|
||||||
*/
|
|
||||||
public function testCoreException()
|
public function testCoreException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(CoreException::class);
|
||||||
throw new CoreException("Exception Test Run", 1);
|
throw new CoreException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\ConfigException
|
|
||||||
*/
|
|
||||||
public function testConfigException()
|
public function testConfigException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(ConfigException::class);
|
||||||
throw new ConfigException("Exception Test Run", 1);
|
throw new ConfigException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\EventException
|
|
||||||
*/
|
|
||||||
public function testEventException()
|
public function testEventException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(EventException::class);
|
||||||
throw new EventException("Exception Test Run", 1);
|
throw new EventException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\FactoryException
|
|
||||||
*/
|
|
||||||
public function testFactoryException()
|
public function testFactoryException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(FactoryException::class);
|
||||||
throw new FactoryException("Exception Test Run", 1);
|
throw new FactoryException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\HelperException
|
|
||||||
*/
|
|
||||||
public function testHelperException()
|
public function testHelperException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(HelperException::class);
|
||||||
throw new HelperException("Exception Test Run", 1);
|
throw new HelperException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testInvalidArgumentException()
|
public function testInvalidArgumentException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(InvalidArgumentException::class);
|
||||||
throw new InvalidArgumentException("Exception Test Run", 1);
|
throw new InvalidArgumentException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\LibraryException
|
|
||||||
*/
|
|
||||||
public function testLibraryException()
|
public function testLibraryException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LibraryException::class);
|
||||||
throw new LibraryException("Exception Test Run", 1);
|
throw new LibraryException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\LoggerException
|
|
||||||
*/
|
|
||||||
public function testLoggerException()
|
public function testLoggerException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LoggerException::class);
|
||||||
throw new LoggerException("Exception Test Run", 1);
|
throw new LoggerException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException FuzeWorks\Exception\ConfiguratorException
|
|
||||||
*/
|
|
||||||
public function testConfiguratorException()
|
public function testConfiguratorException()
|
||||||
{
|
{
|
||||||
|
$this->expectException(ConfiguratorException::class);
|
||||||
throw new ConfiguratorException("Exception Test Run", 1);
|
throw new ConfiguratorException("Exception Test Run", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Factory;
|
use FuzeWorks\Factory;
|
||||||
|
@ -73,10 +73,10 @@ class factoryTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testGetInstance
|
* @depends testGetInstance
|
||||||
* @covers ::getInstance
|
* @covers ::getInstance
|
||||||
* @expectedException \FuzeWorks\Exception\FactoryException
|
|
||||||
*/
|
*/
|
||||||
public function testGetInstanceNotFound()
|
public function testGetInstanceNotFound()
|
||||||
{
|
{
|
||||||
|
$this->expectException(FactoryException::class);
|
||||||
Factory::getInstance('NotFound');
|
Factory::getInstance('NotFound');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,6 @@ class factoryTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testCanLoadFactory
|
* @depends testCanLoadFactory
|
||||||
* @covers ::cloneInstance
|
* @covers ::cloneInstance
|
||||||
* @expectedException FuzeWorks\Exception\FactoryException
|
|
||||||
*/
|
*/
|
||||||
public function testCloneInstanceWrongClassname()
|
public function testCloneInstanceWrongClassname()
|
||||||
{
|
{
|
||||||
|
@ -191,6 +190,7 @@ class factoryTest extends CoreTestAbstract
|
||||||
$factory = new Factory;
|
$factory = new Factory;
|
||||||
|
|
||||||
// Attempt
|
// Attempt
|
||||||
|
$this->expectException(FactoryException::class);
|
||||||
$factory->cloneInstance('fake');
|
$factory->cloneInstance('fake');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,6 @@ class factoryTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testNewFactoryInstance
|
* @depends testNewFactoryInstance
|
||||||
* @covers ::newInstance
|
* @covers ::newInstance
|
||||||
* @expectedException FuzeWorks\Exception\FactoryException
|
|
||||||
*/
|
*/
|
||||||
public function testFactoryNewInstanceNotExist()
|
public function testFactoryNewInstanceNotExist()
|
||||||
{
|
{
|
||||||
|
@ -231,13 +230,13 @@ class factoryTest extends CoreTestAbstract
|
||||||
$factory = new Factory;
|
$factory = new Factory;
|
||||||
|
|
||||||
// First, it does not exist
|
// First, it does not exist
|
||||||
|
$this->expectException(FactoryException::class);
|
||||||
$factory->newInstance('fake');
|
$factory->newInstance('fake');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testNewFactoryInstance
|
* @depends testNewFactoryInstance
|
||||||
* @covers ::newInstance
|
* @covers ::newInstance
|
||||||
* @expectedException FuzeWorks\Exception\FactoryException
|
|
||||||
*/
|
*/
|
||||||
public function testFactoryNewInstanceWrongNamespace()
|
public function testFactoryNewInstanceWrongNamespace()
|
||||||
{
|
{
|
||||||
|
@ -245,6 +244,7 @@ class factoryTest extends CoreTestAbstract
|
||||||
$factory = new Factory;
|
$factory = new Factory;
|
||||||
|
|
||||||
// Second, it just fails
|
// Second, it just fails
|
||||||
|
$this->expectException(FactoryException::class);
|
||||||
$factory->newInstance('helpers', 'Test\\');
|
$factory->newInstance('helpers', 'Test\\');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,6 @@ class factoryTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testRemoveInstance
|
* @depends testRemoveInstance
|
||||||
* @covers ::removeInstance
|
* @covers ::removeInstance
|
||||||
* @expectedException FuzeWorks\Exception\FactoryException
|
|
||||||
*/
|
*/
|
||||||
public function testRemoveInstanceNotExist()
|
public function testRemoveInstanceNotExist()
|
||||||
{
|
{
|
||||||
|
@ -286,6 +285,7 @@ class factoryTest extends CoreTestAbstract
|
||||||
$factory = new Factory;
|
$factory = new Factory;
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
|
$this->expectException(FactoryException::class);
|
||||||
$factory->removeInstance('fake');
|
$factory->removeInstance('fake');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ class factoryTest extends CoreTestAbstract
|
||||||
$this->assertEquals(5, $factory->test);
|
$this->assertEquals(5, $factory->test);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Priority;
|
use FuzeWorks\Priority;
|
||||||
|
@ -52,7 +52,7 @@ class helperTest extends CoreTestAbstract
|
||||||
*/
|
*/
|
||||||
protected $helpers;
|
protected $helpers;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
// Prepare class
|
// Prepare class
|
||||||
$this->helpers = new Helpers();
|
$this->helpers = new Helpers();
|
||||||
|
|
|
@ -31,10 +31,11 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Core;
|
use FuzeWorks\Core;
|
||||||
|
use FuzeWorks\Exception\LibraryException;
|
||||||
use FuzeWorks\Factory;
|
use FuzeWorks\Factory;
|
||||||
use FuzeWorks\Libraries;
|
use FuzeWorks\Libraries;
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ class libraryTest extends CoreTestAbstract
|
||||||
*/
|
*/
|
||||||
protected $libraries;
|
protected $libraries;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
// Load new libraries class
|
// Load new libraries class
|
||||||
$this->libraries = new Libraries();
|
$this->libraries = new Libraries();
|
||||||
|
@ -110,10 +111,10 @@ class libraryTest extends CoreTestAbstract
|
||||||
* @depends testGetLibraryFromDirectory
|
* @depends testGetLibraryFromDirectory
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @covers ::initLibrary
|
* @covers ::initLibrary
|
||||||
* @expectedException FuzeWorks\Exception\LibraryException
|
|
||||||
*/
|
*/
|
||||||
public function testGetLibraryFail()
|
public function testGetLibraryFail()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LibraryException::class);
|
||||||
$this->libraries->get('FailLoadLibrary');
|
$this->libraries->get('FailLoadLibrary');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,10 +122,10 @@ class libraryTest extends CoreTestAbstract
|
||||||
* @depends testGetLibraryFromDirectory
|
* @depends testGetLibraryFromDirectory
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @covers ::initLibrary
|
* @covers ::initLibrary
|
||||||
* @expectedException FuzeWorks\Exception\LibraryException
|
|
||||||
*/
|
*/
|
||||||
public function testGetLibraryNoName()
|
public function testGetLibraryNoName()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LibraryException::class);
|
||||||
$this->libraries->get('');
|
$this->libraries->get('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,10 +133,10 @@ class libraryTest extends CoreTestAbstract
|
||||||
* @depends testGetLibraryFromDirectory
|
* @depends testGetLibraryFromDirectory
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @covers ::initLibrary
|
* @covers ::initLibrary
|
||||||
* @expectedException FuzeWorks\Exception\LibraryException
|
|
||||||
*/
|
*/
|
||||||
public function testGetLibraryNoClass()
|
public function testGetLibraryNoClass()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LibraryException::class);
|
||||||
$this->libraries->get('TestGetLibraryNoClass');
|
$this->libraries->get('TestGetLibraryNoClass');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,10 +189,10 @@ class libraryTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testAddLibraryClass
|
* @depends testAddLibraryClass
|
||||||
* @covers ::addLibraryClass
|
* @covers ::addLibraryClass
|
||||||
* @expectedException \FuzeWorks\Exception\LibraryException
|
|
||||||
*/
|
*/
|
||||||
public function testAddLibraryClassFail()
|
public function testAddLibraryClassFail()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LibraryException::class);
|
||||||
$this->libraries->addLibraryClass('LibraryClassFail', '\Case\Not\Exist');
|
$this->libraries->addLibraryClass('LibraryClassFail', '\Case\Not\Exist');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,14 +215,14 @@ class libraryTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testAddLibraryWithAutoloader
|
* @depends testAddLibraryWithAutoloader
|
||||||
* @covers ::initLibrary
|
* @covers ::initLibrary
|
||||||
* @expectedException \FuzeWorks\Exception\LibraryException
|
|
||||||
*/
|
*/
|
||||||
public function testAddBadAutoloader()
|
public function testAddBadAutoloader()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LibraryException::class);
|
||||||
$this->assertInstanceOf('Application\Library\TestAddBadAutoloader', $this->libraries->get('TestAddBadAutoloader'));
|
$this->assertInstanceOf('Application\Library\TestAddBadAutoloader', $this->libraries->get('TestAddBadAutoloader'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 0.0.1
|
* @since Version 0.0.1
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Events;
|
use FuzeWorks\Events;
|
||||||
|
@ -51,7 +51,7 @@ class loggerTest extends CoreTestAbstract
|
||||||
|
|
||||||
protected $output;
|
protected $output;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
Factory::getInstance()->config->get('error')->fuzeworks_error_reporting = false;
|
Factory::getInstance()->config->get('error')->fuzeworks_error_reporting = false;
|
||||||
Logger::$logs = array();
|
Logger::$logs = array();
|
||||||
|
@ -211,7 +211,7 @@ class loggerTest extends CoreTestAbstract
|
||||||
$this->assertFalse(Logger::isEnabled());
|
$this->assertFalse(Logger::isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,11 @@
|
||||||
* @link http://techfuze.net/fuzeworks
|
* @link http://techfuze.net/fuzeworks
|
||||||
* @since Version 1.1.4
|
* @since Version 1.1.4
|
||||||
*
|
*
|
||||||
* @version Version 1.2.0
|
* @version Version 1.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use FuzeWorks\Core;
|
use FuzeWorks\Core;
|
||||||
|
use FuzeWorks\Exception\PluginException;
|
||||||
use FuzeWorks\Factory;
|
use FuzeWorks\Factory;
|
||||||
use FuzeWorks\Plugins;
|
use FuzeWorks\Plugins;
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ class pluginTest extends CoreTestAbstract
|
||||||
*/
|
*/
|
||||||
protected $plugins;
|
protected $plugins;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
$this->plugins = new Plugins();
|
$this->plugins = new Plugins();
|
||||||
$this->plugins->init();
|
$this->plugins->init();
|
||||||
|
@ -106,10 +107,10 @@ class pluginTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testLoadPlugin
|
* @depends testLoadPlugin
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testMissingHeader()
|
public function testMissingHeader()
|
||||||
{
|
{
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('testMissingHeader');
|
$this->plugins->get('testMissingHeader');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,39 +135,39 @@ class pluginTest extends CoreTestAbstract
|
||||||
/**
|
/**
|
||||||
* @depends testLoadPlugin
|
* @depends testLoadPlugin
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testMissingPlugin()
|
public function testMissingPlugin()
|
||||||
{
|
{
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('testMissingPlugin');
|
$this->plugins->get('testMissingPlugin');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testMissingPlugin
|
* @depends testMissingPlugin
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testLoadHeaderNotIPluginHeader()
|
public function testLoadHeaderNotIPluginHeader()
|
||||||
{
|
{
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('TestLoadHeaderNotIPluginHeader');
|
$this->plugins->get('TestLoadHeaderNotIPluginHeader');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testLoadPlugin
|
* @depends testLoadPlugin
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testInvalidClass()
|
public function testInvalidClass()
|
||||||
{
|
{
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('testInvalidClass');
|
$this->plugins->get('testInvalidClass');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testGetMissingName()
|
public function testGetMissingName()
|
||||||
{
|
{
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('');
|
$this->plugins->get('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,12 +175,12 @@ class pluginTest extends CoreTestAbstract
|
||||||
* @depends testLoadPlugin
|
* @depends testLoadPlugin
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @covers ::loadHeadersFromPluginPaths
|
* @covers ::loadHeadersFromPluginPaths
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testDisabledPlugin()
|
public function testDisabledPlugin()
|
||||||
{
|
{
|
||||||
Factory::getInstance()->config->plugins->disabled_plugins = array('TestDisabledPlugin');
|
Factory::getInstance()->config->plugins->disabled_plugins = array('TestDisabledPlugin');
|
||||||
$this->plugins->loadHeadersFromPluginPaths();
|
$this->plugins->loadHeadersFromPluginPaths();
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('testDisabledPlugin');
|
$this->plugins->get('testDisabledPlugin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,16 +188,16 @@ class pluginTest extends CoreTestAbstract
|
||||||
* @depends testLoadPlugin
|
* @depends testLoadPlugin
|
||||||
* @covers ::get
|
* @covers ::get
|
||||||
* @covers ::loadHeadersFromPluginPaths
|
* @covers ::loadHeadersFromPluginPaths
|
||||||
* @expectedException FuzeWorks\Exception\PluginException
|
|
||||||
*/
|
*/
|
||||||
public function testRunInvalidDirectory()
|
public function testRunInvalidDirectory()
|
||||||
{
|
{
|
||||||
$this->plugins->addComponentPath('exists_not');
|
$this->plugins->addComponentPath('exists_not');
|
||||||
$this->plugins->loadHeadersFromPluginPaths();
|
$this->plugins->loadHeadersFromPluginPaths();
|
||||||
|
$this->expectException(PluginException::class);
|
||||||
$this->plugins->get('testRunInvalidDirectory');
|
$this->plugins->get('testRunInvalidDirectory');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown(): void
|
||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,6 @@
|
||||||
</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>
|
<filter>
|
||||||
<whitelist processUncoveredFilesFromWhitelist="false">
|
<whitelist processUncoveredFilesFromWhitelist="false">
|
||||||
<directory suffix=".php">../</directory>
|
<directory suffix=".php">../</directory>
|
||||||
|
|
Loading…
Reference in New Issue