Refactored project structure (Improvements).

This commit is contained in:
Dmitry Khomutov 2018-03-04 21:33:35 +07:00
parent c015d8c58b
commit 3b700f8d3c
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
5 changed files with 5 additions and 23 deletions

View file

@ -26,12 +26,7 @@ if (!defined('RUNTIME_DIR')) {
require_once(ROOT_DIR . 'vendor/autoload.php');
// Load configuration if present:
$conf = [];
$conf['b8']['app']['namespace'] = 'PHPCensor';
$conf['b8']['app']['default_controller'] = 'Home';
$config = new PHPCensor\Config($conf);
$config = new PHPCensor\Config();
$configFile = APP_DIR . 'config.yml';
if (file_exists($configFile)) {

View file

@ -281,7 +281,7 @@ class Application
$namespace = $this->toPhpName($route['namespace']);
$controller = $this->toPhpName($route['controller']);
return $this->config->get('b8.app.namespace') . '\\' . $namespace . '\\' . $controller . 'Controller';
return 'PHPCensor\\' . $namespace . '\\' . $controller . 'Controller';
}
/**

View file

@ -26,11 +26,8 @@ if (!defined('RUNTIME_DIR')) {
require_once(ROOT_DIR . 'vendor/autoload.php');
$conf = [];
$conf['b8']['app']['namespace'] = 'PHPCensor';
$conf['b8']['app']['default_controller'] = 'Home';
$conf['php-censor']['url'] = 'http://php-censor.local';
$conf = [];
$conf['php-censor']['url'] = 'http://php-censor.local';
$config = new PHPCensor\Config($conf);

View file

@ -56,13 +56,7 @@ class EmailTest extends \PHPUnit\Framework\TestCase
$this->mailDelivered = true;
$self = $this;
$config = new Config([
'b8' => [
'view' => [
'path' => SRC_DIR . 'View/'
]
]
]);
new Config();
$this->mockProject = $this
->getMockBuilder('\PHPCensor\Model\Project')

View file

@ -48,8 +48,6 @@ class PhpUnitResultTest extends \PHPUnit\Framework\TestCase
self::assertContains('Incomplete Test:', $output[5]['message']);
} catch (\PHPUnit_Framework_ExpectationFailedException $e) {
self::$skipped[] = ['cls' => $resultClass, 'ex' => $e];
} catch (\PHPUnit\Framework\ExpectationFailedException $e) {
self::$skipped[] = ['cls' => $resultClass, 'ex' => $e];
}
self::assertEquals(PhpUnitResult::SEVERITY_SKIPPED, $output[11]['severity']);
@ -57,8 +55,6 @@ class PhpUnitResultTest extends \PHPUnit\Framework\TestCase
self::assertContains('Skipped Test:', $output[11]['message']);
} catch (\PHPUnit_Framework_ExpectationFailedException $e) {
self::$skipped[] = ['cls' => $resultClass, 'ex' => $e];
} catch (\PHPUnit\Framework\ExpectationFailedException $e) {
self::$skipped[] = ['cls' => $resultClass, 'ex' => $e];
}
}