From ffd4a81db6c7fb2a9470c4937170fadf26e811b6 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 9 Jul 2019 17:04:50 +0200 Subject: [PATCH] Fix tests --- Components/Collectors/GeneralCollector.php | 2 +- composer.json | 47 +++++++++++++--------- tests/Functional/bootstrap.php | 3 +- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Components/Collectors/GeneralCollector.php b/Components/Collectors/GeneralCollector.php index 846bfec..d5be12c 100644 --- a/Components/Collectors/GeneralCollector.php +++ b/Components/Collectors/GeneralCollector.php @@ -49,7 +49,7 @@ public function collect(Enlight_Controller_Action $controller, Profile $profile) 'moduleName' => $controller->Request()->getModuleName(), 'controllerName' => $controller->Request()->getControllerName(), 'actionName' => $controller->Request()->getActionName(), - 'httpMethod' => $controller->Request()->getMethod(), + 'httpMethod' => $controller->Request()->getRealMethod(), 'params' => $controller->Request()->getParams(), 'get' => $controller->Request()->getQuery(), 'post' => $controller->Request()->getPost(), diff --git a/composer.json b/composer.json index d265f8d..107c02e 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,29 @@ { - "name": "frosh/shopware-profiler", - "keywords": ["shopware", "profiling", "plugin"], - "description": "Profiling for Shopware", - "license": "MIT", - "type": "shopware-plugin", - "extra": { - "installer-name": "FroshProfiler" - }, - "require": { - "php": ">=7.1", - "jdorn/sql-formatter": "^1.2.17", - "composer/installers": "~1.0", - "symfony/stopwatch": "^4.1", - "psr/log": "^1.0", - "symfony/var-dumper": "^4.1" - }, - "scripts": { - "test": "phpunit -c tests/ --colors=always", - "test-unit": "phpunit -c tests/phpunit_unit.xml --colors=always" - } + "name": "frosh/shopware-profiler", + "keywords": [ + "shopware", + "profiling", + "plugin" + ], + "description": "Profiling for Shopware", + "license": "MIT", + "type": "shopware-plugin", + "extra": { + "installer-name": "FroshProfiler" + }, + "require": { + "php": ">=7.2", + "jdorn/sql-formatter": "^1.2.17", + "composer/installers": "~1.0", + "symfony/stopwatch": "^4.1", + "psr/log": "^1.0", + "symfony/var-dumper": "^4.1" + }, + "require-dev": { + "phpunit/phpunit": "~6.0" + }, + "scripts": { + "test": "phpunit -c tests/ --colors=always", + "test-unit": "phpunit -c tests/phpunit_unit.xml --colors=always" + } } diff --git a/tests/Functional/bootstrap.php b/tests/Functional/bootstrap.php index a66c252..ac511ea 100644 --- a/tests/Functional/bootstrap.php +++ b/tests/Functional/bootstrap.php @@ -24,6 +24,7 @@ define('TESTS_RUNNING', true); $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; +$_SERVER['SERVER_REQUEST_METHOD'] = 'GET'; $searchDirectory = dirname(dirname(__DIR__)); while (true) { @@ -37,4 +38,4 @@ require $autoloadFile; break; } -} \ No newline at end of file +}