Updated FuzeWorks Application Skeleton to FuzeWorks 1.1.1

This commit is contained in:
Abel Hoogeveen 2018-01-14 14:05:52 +01:00
parent e02a5b4279
commit 88b5d10e6b
2 changed files with 8 additions and 5 deletions

View File

@ -15,7 +15,7 @@
], ],
"require": { "require": {
"php": ">=7.0.0", "php": ">=7.0.0",
"fuzeworks/core": "1.1.0", "fuzeworks/core": "1.1.1",
"latte/latte": "2.4.*", "latte/latte": "2.4.*",
"tracy/tracy": "2.4.*", "tracy/tracy": "2.4.*",
"smarty/smarty": "3.1.*" "smarty/smarty": "3.1.*"

View File

@ -30,6 +30,7 @@
* @version Version 1.0.0 * @version Version 1.0.0
*/ */
use PHPUnit\Framework\TestCase;
use Application\Controller\Standard; use Application\Controller\Standard;
use FuzeWorks\Layout; use FuzeWorks\Layout;
use FuzeWorks\Factory; use FuzeWorks\Factory;
@ -44,11 +45,13 @@ class standardTest extends TestCase
{ {
private $controller; private $controller;
private $factory;
public function setUp() public function setUp()
{ {
require_once('application/Controller/controller.standard.php'); require_once('application/Controller/controller.standard.php');
$this->controller = new Standard(); $this->controller = new Standard();
$this->factory = Factory::getInstance();
} }
public function testType() public function testType()
@ -59,12 +62,12 @@ class standardTest extends TestCase
public function testIndex() public function testIndex()
{ {
// First set a test file ready // First set a test file ready
Layout::setDirectory(dirname(__FILE__) . '/testIndex/'); $this->factory->layout->setDirectory(dirname(__FILE__) . '/testIndex/');
// Perform and retrieve the output // Perform and retrieve the output
ob_start(); ob_start();
$this->controller->index(); $this->controller->index();
Factory::getInstance()->output->_display(); $this->factory->output->_display();
$output = ob_get_contents(); $output = ob_get_contents();
ob_end_clean(); ob_end_clean();
@ -73,8 +76,8 @@ class standardTest extends TestCase
public function tearDown() public function tearDown()
{ {
Layout::reset(); $this->factory->layout->reset();
Factory::getInstance()->output->set_output(''); $this->factory->output->set_output('');
} }