Permalink
Browse files

Refactored project structure.

  • Loading branch information...
corpsee committed Mar 4, 2018
1 parent cfe9343 commit c015d8c58b951bbaad6229ea89788b44dd52dc87
Showing 308 changed files with 39 additions and 47 deletions.
View
@@ -6,7 +6,7 @@ coverage:
- "runtime"
- "tests"
- "vendor"
- "src/PHPCensor/Migrations"
- "src/PHPCensor/Languages"
- "src/Migrations"
- "src/Languages"
comment: off
View
@@ -5,7 +5,7 @@
}
if (!defined('SRC_DIR')) {
define('SRC_DIR', ROOT_DIR . 'src/PHPCensor/');
define('SRC_DIR', ROOT_DIR . 'src/');
}
if (!defined('PUBLIC_DIR')) {
View
@@ -36,14 +36,12 @@
},
"autoload": {
"psr-4": {
"PHPCensor\\": "src/PHPCensor/",
"b8\\": "src/B8Framework/"
"PHPCensor\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\PHPCensor\\": "tests/PHPCensor/",
"Tests\\b8\\": "tests/B8Framework/"
"Tests\\PHPCensor\\": "tests/src/"
}
},
"require": {
View
@@ -20,20 +20,16 @@
<const name="POSTGRESQL_DBNAME" value="b8_test" />
</php>
<testsuites>
<testsuite name="B8Framework Test Suite">
<directory suffix="Test.php">./tests/B8Framework</directory>
</testsuite>
<testsuite name="PHP Common Test Suite">
<directory suffix="Test.php">./tests/PHPCensor</directory>
<directory suffix="Test.php">./tests/src</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./src/PHPCensor/Migrations</directory>
<directory suffix=".php">./src/PHPCensor/Languages</directory>
<directory suffix=".php">./src/Migrations</directory>
<directory suffix=".php">./src/Languages</directory>
</exclude>
</whitelist>
</filter>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -86,7 +86,7 @@ public function __construct($name = 'PHP Censor', $version = 'UNKNOWN')
if ($databaseSettings) {
$phinxSettings = [
'paths' => [
'migrations' => ROOT_DIR . 'src/PHPCensor/Migrations',
'migrations' => ROOT_DIR . 'src/Migrations',
],
'environments' => [
'default_migration_table' => 'migration',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -167,18 +167,12 @@ public function setParent(Element $parent)
*/
public function render($viewFile = null)
{
$viewPath = SRC_DIR . 'View/';
if (is_null($viewFile)) {
$class = explode('\\', get_called_class());
$viewFile = end($class);
}
if (file_exists($viewPath . 'Form/' . $viewFile . '.phtml')) {
$view = new View('Form/' . $viewFile);
} else {
$view = new View($viewFile, SRC_DIR . 'Form/View/');
}
$view = new View('Form/' . $viewFile);
$view->name = $this->getName();
$view->id = $this->getId();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -9,7 +9,7 @@
/**
* PHPTAL Lint Plugin - Provides access to PHPTAL lint functionality.
*
*
* @author Stephen Ball <phpci@stephen.rebelinblue.com>
*/
class PhpTalLint extends Plugin
@@ -174,7 +174,7 @@ protected function lintFile($path)
list($suffixes, $tales) = $this->getFlags();
$lint = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
$lint = __DIR__ . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR;
$lint .= 'vendor' . DIRECTORY_SEPARATOR . 'phptal' . DIRECTORY_SEPARATOR . 'phptal' . DIRECTORY_SEPARATOR;
$lint .= 'tools' . DIRECTORY_SEPARATOR . 'phptal_lint.php';
$cmd = '/usr/bin/env php ' . $lint . ' %s %s "%s"';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
<html>
<head>
<style>
<?php include(__DIR__ . '/../../../../public/assets/css/ansi-colors.css'); ?>
<?php include(__DIR__ . '/../../../public/assets/css/ansi-colors.css'); ?>
body { font-family: arial, verdana, sans-serif; font-size: 15px; }
header { font-size: 25px; margin-bottom: 15px; }
</style>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -5,7 +5,7 @@
}
if (!defined('SRC_DIR')) {
define('SRC_DIR', ROOT_DIR . 'src/PHPCensor/');
define('SRC_DIR', ROOT_DIR . 'src/');
}
if (!defined('PUBLIC_DIR')) {
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
<?php
namespace Tests\PHPCensor\Plugin\Command;
namespace Tests\PHPCensor\Command;
use PHPCensor\Command\CreateAdminCommand;
use Symfony\Component\Console\Application;
@@ -1,6 +1,6 @@
<?php
namespace Tests\PHPCensor\Plugin\Command;
namespace Tests\PHPCensor\Command;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
@@ -3,7 +3,6 @@
namespace Tests\PHPCensor;
use PHPCensor\Form;
use PHPCensor\Config;
class FormTest extends \PHPUnit\Framework\TestCase
{
@@ -1,6 +1,6 @@
<?php
namespace Tests\PHPCensor\Plugin\Helper;
namespace Tests\PHPCensor\Helper;
use PHPCensor\Helper\BuildInterpolator;
@@ -1,6 +1,6 @@
<?php
namespace tests\PHPCensor\Service;
namespace Tests\PHPCensor\Helper;
use PHPCensor\Helper\MailerFactory;
@@ -1,6 +1,6 @@
<?php
namespace Tests\PHPCensor\Plugin\Helper;
namespace Tests\PHPCensor\Logging;
use PHPCensor\Logging\BuildLogger;
use Prophecy\Argument;
File renamed without changes.
@@ -1,6 +1,6 @@
<?php
namespace Tests\PHPCensor\Plugin;
namespace Tests\PHPCensor\Plugin\Option;
use PHPCensor\Plugin\Option\PhpUnitOptions;
@@ -31,7 +31,7 @@ protected function getPlugin(array $options = [])
protected function buildTemp()
{
$directory = tempnam(ROOT_DIR . 'tests' . DIRECTORY_SEPARATOR . 'temp' . DIRECTORY_SEPARATOR, 'source');
$directory = tempnam(ROOT_DIR . 'tests/runtime/', 'source');
unlink($directory);
return $directory;
}
@@ -33,7 +33,7 @@ protected function setUp()
protected function getFakePluginClassName($pluginName)
{
$pluginNamespace = '\\Tests\\PHPCensor\\Plugin\\Util\\Fake\\';
$pluginNamespace = 'Tests\\PHPCensor\\Plugin\\Util\\Fake\\';
return $pluginNamespace . $pluginName;
}
@@ -44,9 +44,10 @@ public function testExecutePlugin_AssumesNamespaceIfNoneGiven()
$pluginName = 'PhpUnit';
$pluginNamespace = 'PHPCensor\\Plugin\\';
$this->mockFactory->buildPlugin($pluginNamespace . $pluginName, $options)
->shouldBeCalledTimes(1)
->willReturn($this->prophesize('PHPCensor\Plugin')->reveal());
$this->mockFactory
->buildPlugin($pluginNamespace . $pluginName, $options)
->shouldBeCalledTimes(1)
->willReturn($this->prophesize('PHPCensor\Plugin')->reveal());
$this->testedExecutor->executePlugin($pluginName, $options);
}
@@ -56,9 +57,10 @@ public function testExecutePlugin_KeepsCalledNameSpace()
$options = [];
$pluginClass = $this->getFakePluginClassName('ExamplePluginFull');
$this->mockFactory->buildPlugin($pluginClass, $options)
->shouldBeCalledTimes(1)
->willReturn($this->prophesize('PHPCensor\Plugin')->reveal());
$this->mockFactory
->buildPlugin($pluginClass, $options)
->shouldBeCalledTimes(1)
->willReturn($this->prophesize('PHPCensor\Plugin')->reveal());
$this->testedExecutor->executePlugin($pluginClass, $options);
}
@@ -83,8 +83,8 @@ public function testSkippedAnything()
public static function getTestData()
{
return [
'json' => [PhpUnitResultJson::class, 'tests/PHPCensor/Plugin/SampleFiles/phpunit_money.txt'],
'junit' => [PhpUnitResultJunit::class, 'tests/PHPCensor/Plugin/SampleFiles/phpunit_money_junit.xml'],
'json' => [PhpUnitResultJson::class, 'tests/data/Plugin/PhpUnit/phpunit_money.txt'],
'junit' => [PhpUnitResultJunit::class, 'tests/data/Plugin/PhpUnit/phpunit_money_junit.xml'],
];
}
}
@@ -1,4 +1,5 @@
<?php
namespace Tests\PHPCensor\ProcessControl;
use PHPCensor\ProcessControl\PosixProcessControl;
@@ -1,4 +1,5 @@
<?php
namespace Tests\PHPCensor\ProcessControl;
/**
@@ -1,4 +1,5 @@
<?php
namespace Tests\PHPCensor\ProcessControl;
use PHPCensor\ProcessControl\UnixProcessControl;
Oops, something went wrong.

0 comments on commit c015d8c

Please sign in to comment.