diff --git a/.gitignore b/.gitignore index 74c7d808a2f6985ab4bb2586cec8c4c5ad8037fb..ae664ef2e8645ce007c5d2a7d4650cacff22dcb6 100755 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ apps/maarch_entreprise/xml/log4php.xml .phplint.yml *.log xdelete.sh -core/Test/build/ +test/build/ apps/maarch_entreprise/js/angular/main.bundle.js modules/convert/batch/scripts/launch_fulltext_letterbox.sh modules/convert/batch/scripts/launch_convert_letterbox.sh diff --git a/phpunit.xml b/phpunit.xml index 149eea019db87de1facb8926ae607d893a5c910b..ed98f20dcc609a0785a584aaf98b40d0244353a1 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,49 +1,43 @@ <?xml version="1.0" encoding="UTF-8"?> -<phpunit colors="true" bootstrap="core/Test/define.php"> +<phpunit colors="true" bootstrap="test/define.php"> <testsuites> - <testsuite name="Maarch Core Test Suite"> - <!--directory>core/Test</directory--> - <file>core/Test/ActionControllerTest.php</file> - <file>core/Test/AutocompleteControllerTest.php</file> - <file>core/Test/BasketControllerTest.php</file> - <file>core/Test/ContactControllerTest.php</file> - <file>core/Test/ContactGroupControllerTest.php</file> - <file>core/Test/ContactTypeControllerTest.php</file> - <file>core/Test/DocserverControllerTest.php</file> - <file>core/Test/DoctypeControllerTest.php</file> - <file>core/Test/EntityControllerTest.php</file> - <file>core/Test/GroupControllerTest.php</file> - <file>core/Test/ListTemplateControllerTest.php</file> - <file>core/Test/NotificationControllerTest.php</file> - <file>core/Test/NotificationScheduleControllerTest.php</file> - <file>core/Test/ParameterControllerTest.php</file> - <file>core/Test/PriorityControllerTest.php</file> - <file>core/Test/ReportControllerTest.php</file> - <file>core/Test/ResControllerTest.php</file> - <file>core/Test/StatusControllerTest.php</file> - <file>core/Test/UserControllerTest.php</file> - <file>core/Test/VersionUpdateControllerTest.php</file> - <file>core/Test/CoreControllerTest.php</file> - <file>core/Test/TemplateControllerTest.php</file> - <!--<file>modules/convert/Test/ProcessConvertTest.php</file>--> - <!--<file>modules/convert/Test/ProcessFulltextTest.php</file>--> - <!--<file>modules/convert/Test/ProcessManageConvertTest.php</file>--> - <!--<file>modules/convert/Test/ProcessThumbnailsTest.php</file>--> + <testsuite name="Maarch Test Suite"> + <!--directory>test</directory--> + <file>test/ActionControllerTest.php</file> + <file>test/AutocompleteControllerTest.php</file> + <file>test/BasketControllerTest.php</file> + <file>test/ContactControllerTest.php</file> + <file>test/ContactGroupControllerTest.php</file> + <file>test/ContactTypeControllerTest.php</file> + <file>test/DocserverControllerTest.php</file> + <file>test/DoctypeControllerTest.php</file> + <file>test/EntityControllerTest.php</file> + <file>test/GroupControllerTest.php</file> + <file>test/ListTemplateControllerTest.php</file> + <file>test/NotificationControllerTest.php</file> + <file>test/NotificationScheduleControllerTest.php</file> + <file>test/ParameterControllerTest.php</file> + <file>test/PriorityControllerTest.php</file> + <file>test/ReportControllerTest.php</file> + <file>test/ResControllerTest.php</file> + <file>test/StatusControllerTest.php</file> + <file>test/UserControllerTest.php</file> + <file>test/VersionUpdateControllerTest.php</file> + <file>test/CoreControllerTest.php</file> + <file>test/TemplateControllerTest.php</file> <!-- The last one should be history --> - <file>core/Test/HistoryControllerTest.php</file> + <file>test/HistoryControllerTest.php</file> </testsuite> </testsuites> <filter> <whitelist> <directory suffix="Test.php">core/Test</directory> <directory suffix=".php">src</directory> - <!--<directory suffix=".php">modules/convert/Controllers</directory>--> - <!--<directory suffix=".php">modules/convert/Models</directory>--> </whitelist> </filter> <logging> - <log type="coverage-clover" target="core/Test/build/tests-clover.xml"/> - <log type="junit" target="core/Test/build/tests-phpunit.xml" logIncompleteSkipped="false"/> - <log type="coverage-html" target="core/Test/build" lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="test/build/tests-clover.xml"/> + <log type="junit" target="test/build/tests-phpunit.xml" logIncompleteSkipped="false"/> + <log type="coverage-html" target="test/build" lowUpperBound="35" highLowerBound="70"/> </logging> </phpunit> diff --git a/core/Test/ActionControllerTest.php b/test/ActionControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/ActionControllerTest.php rename to test/ActionControllerTest.php diff --git a/core/Test/AutocompleteControllerTest.php b/test/AutocompleteControllerTest.php similarity index 100% rename from core/Test/AutocompleteControllerTest.php rename to test/AutocompleteControllerTest.php diff --git a/core/Test/BasketControllerTest.php b/test/BasketControllerTest.php similarity index 100% rename from core/Test/BasketControllerTest.php rename to test/BasketControllerTest.php diff --git a/core/Test/ContactControllerTest.php b/test/ContactControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/ContactControllerTest.php rename to test/ContactControllerTest.php diff --git a/core/Test/ContactGroupControllerTest.php b/test/ContactGroupControllerTest.php similarity index 100% rename from core/Test/ContactGroupControllerTest.php rename to test/ContactGroupControllerTest.php diff --git a/core/Test/ContactTypeControllerTest.php b/test/ContactTypeControllerTest.php similarity index 100% rename from core/Test/ContactTypeControllerTest.php rename to test/ContactTypeControllerTest.php diff --git a/core/Test/CoreControllerTest.php b/test/CoreControllerTest.php similarity index 100% rename from core/Test/CoreControllerTest.php rename to test/CoreControllerTest.php diff --git a/core/Test/DocserverControllerTest.php b/test/DocserverControllerTest.php similarity index 100% rename from core/Test/DocserverControllerTest.php rename to test/DocserverControllerTest.php diff --git a/core/Test/DoctypeControllerTest.php b/test/DoctypeControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/DoctypeControllerTest.php rename to test/DoctypeControllerTest.php diff --git a/core/Test/EntityControllerTest.php b/test/EntityControllerTest.php similarity index 100% rename from core/Test/EntityControllerTest.php rename to test/EntityControllerTest.php diff --git a/core/Test/GroupControllerTest.php b/test/GroupControllerTest.php similarity index 100% rename from core/Test/GroupControllerTest.php rename to test/GroupControllerTest.php diff --git a/core/Test/HistoryControllerTest.php b/test/HistoryControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/HistoryControllerTest.php rename to test/HistoryControllerTest.php diff --git a/core/Test/ListTemplateControllerTest.php b/test/ListTemplateControllerTest.php similarity index 100% rename from core/Test/ListTemplateControllerTest.php rename to test/ListTemplateControllerTest.php diff --git a/core/Test/NotificationControllerTest.php b/test/NotificationControllerTest.php similarity index 100% rename from core/Test/NotificationControllerTest.php rename to test/NotificationControllerTest.php diff --git a/core/Test/NotificationScheduleControllerTest.php b/test/NotificationScheduleControllerTest.php similarity index 95% rename from core/Test/NotificationScheduleControllerTest.php rename to test/NotificationScheduleControllerTest.php index 99d312efa26cbc8d88f0ada4a9ffc4a3eecb620d..a3f770f46b556f2dd3f0e9e8923ee7ffa4d2dc54 100644 --- a/core/Test/NotificationScheduleControllerTest.php +++ b/test/NotificationScheduleControllerTest.php @@ -63,10 +63,9 @@ class NotificationScheduleControllerTest extends TestCase $responseBody = json_decode((string) $response->getBody()); // CREATE FAIL - $aArgs = []; $aArgs = $responseBody->crontab; - $corePath = dirname(__FILE__, 3).'/'; + $corePath = dirname(__FILE__, 2).'/'; $newCrontab = [ 'm' => 12, 'h' => 23, @@ -88,10 +87,9 @@ class NotificationScheduleControllerTest extends TestCase $environment = \Slim\Http\Environment::mock(['REQUEST_METHOD' => 'POST']); $request = \Slim\Http\Request::createFromEnvironment($environment); - $aArgs = []; $aArgs = $responseBody->crontab; - $corePath = dirname(__FILE__, 3).'/'; + $corePath = dirname(__FILE__, 2).'/'; $newCrontab = [ 'm' => 12, 'h' => 23, @@ -138,10 +136,9 @@ class NotificationScheduleControllerTest extends TestCase $environment = \Slim\Http\Environment::mock(['REQUEST_METHOD' => 'POST']); $request = \Slim\Http\Request::createFromEnvironment($environment); - $aArgs = []; $aArgs = $responseBody->crontab; - $corePath = dirname(__FILE__, 3).'/'; + $corePath = dirname(__FILE__, 2).'/'; $aArgs[count($aArgs) - 1] = [ 'm' => 35, @@ -181,11 +178,10 @@ class NotificationScheduleControllerTest extends TestCase $response = $NotificationScheduleController->get($request, new \Slim\Http\Response()); $responseBody = json_decode((string) $response->getBody()); - $aArgs = []; $aArgs = $responseBody->crontab; foreach ($aArgs as $id => $value) { - if ($value->cmd == dirname(__FILE__, 3).'/'.'modules/notifications/batch/scripts/notification_testtu.sh') { + if ($value->cmd == dirname(__FILE__, 2).'/'.'modules/notifications/batch/scripts/notification_testtu.sh') { $aArgs[$id]->state = 'hidden'; } } @@ -200,11 +196,10 @@ class NotificationScheduleControllerTest extends TestCase $this->assertSame('Problem with crontab', $responseBodyFail->errors); // DELETE - $aArgs = []; $aArgs = $responseBody->crontab; foreach ($aArgs as $id => $value) { - if ($value->cmd == dirname(__FILE__, 3).'/'.'modules/notifications/batch/scripts/notification_testtu.sh') { + if ($value->cmd == dirname(__FILE__, 2).'/'.'modules/notifications/batch/scripts/notification_testtu.sh') { $aArgs[$id]->state = 'deleted'; } } diff --git a/core/Test/ParameterControllerTest.php b/test/ParameterControllerTest.php similarity index 100% rename from core/Test/ParameterControllerTest.php rename to test/ParameterControllerTest.php diff --git a/core/Test/PriorityControllerTest.php b/test/PriorityControllerTest.php similarity index 100% rename from core/Test/PriorityControllerTest.php rename to test/PriorityControllerTest.php diff --git a/core/Test/ReportControllerTest.php b/test/ReportControllerTest.php similarity index 100% rename from core/Test/ReportControllerTest.php rename to test/ReportControllerTest.php diff --git a/core/Test/ResControllerTest.php b/test/ResControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/ResControllerTest.php rename to test/ResControllerTest.php diff --git a/core/Test/StatusControllerTest.php b/test/StatusControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/StatusControllerTest.php rename to test/StatusControllerTest.php diff --git a/core/Test/TemplateControllerTest.php b/test/TemplateControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/TemplateControllerTest.php rename to test/TemplateControllerTest.php diff --git a/core/Test/UserControllerTest.php b/test/UserControllerTest.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/UserControllerTest.php rename to test/UserControllerTest.php diff --git a/core/Test/VersionUpdateControllerTest.php b/test/VersionUpdateControllerTest.php similarity index 100% rename from core/Test/VersionUpdateControllerTest.php rename to test/VersionUpdateControllerTest.php diff --git a/core/Test/define.php b/test/define.php old mode 100755 new mode 100644 similarity index 100% rename from core/Test/define.php rename to test/define.php