Skip to content

Commit 149351d

Browse files
AdrienClairembaultcedric-anne
authored andcommitted
Fix running web tests locally
1 parent 4ca2779 commit 149351d

File tree

5 files changed

+3
-24
lines changed

5 files changed

+3
-24
lines changed

install/install.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -416,16 +416,6 @@ function step8()
416416
]
417417
);
418418

419-
$url_base_api = "$url_base/apirest.php/";
420-
$DB->update(
421-
'glpi_configs',
422-
['value' => $url_base_api],
423-
[
424-
'context' => 'core',
425-
'name' => 'url_base_api',
426-
]
427-
);
428-
429419
Session::destroy(); // Remove session data (debug mode for instance) set by web installation
430420

431421
TemplateRenderer::getInstance()->display('install/step8.html.twig');

phpunit/web/APIRestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function setUp(): void
7676
$this->assertNotSame(false, $file_updated);
7777

7878
$this->http_client = new GuzzleHttp\Client();
79-
$this->base_uri = trim($CFG_GLPI['url_base_api'], "/") . "/";
79+
$this->base_uri = \Glpi\Api\HL\Router::getAPIVersions()[0]['endpoint'] . '/';
8080

8181
$this->initSessionCredentials();
8282
parent::setUp();

templates/pages/setup/general/api_setup.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
'',
4949
endpoint_doc
5050
) }}
51-
{{ fields.textField('url_base_api', api_url, __('URL of the API'), {
51+
{{ fields.textField('_url_base_api', api_url, __('URL of the API'), {
5252
readonly: true,
5353
copyable: true
5454
}) }}
@@ -81,7 +81,7 @@
8181
legacy_doc
8282
) }}
8383
{{ fields.nullField() }}
84-
{{ fields.textField('legacy_url_base_api', legacy_api_url, __('URL of the API'), {
84+
{{ fields.textField('_legacy_url_base_api', legacy_api_url, __('URL of the API'), {
8585
readonly: true,
8686
copyable: true
8787
}) }}

tests/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ $ atoum -bf tests/bootstrap.php -f tests/functional/Html.php -m tests\units\Html
6565
```
6666
In `tests\units\Html::testConvDateTime`, you may need to double the backslashes (depending on the shell you use);
6767

68-
If you want to run the API tests suite, you need to run a development server:
69-
70-
```bash
71-
php -S localhost:8088 -t public tests/router.php &>/dev/null &
72-
```
7368

7469
Running `atoum` without any arguments will show you the possible options. Most important are:
7570
- `-bf` to set bootstrap file,

tests/src/autoload/functions.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -728,12 +728,6 @@ function loadDataset()
728728

729729
$DB->beginTransaction();
730730

731-
Config::setConfigurationValues('core', ['url_base' => GLPI_URI,
732-
'url_base_api' => GLPI_URI . '/apirest.php',
733-
]);
734-
$CFG_GLPI['url_base'] = GLPI_URI;
735-
$CFG_GLPI['url_base_api'] = GLPI_URI . '/apirest.php';
736-
737731
// make all caldav component available for tests (for default usage we don't VTODO)
738732
$CFG_GLPI['caldav_supported_components'] = ['VEVENT', 'VJOURNAL', 'VTODO'];
739733

0 commit comments

Comments
 (0)