diff --git a/tests/API/HealthcheckControllerTest.php b/tests/API/HealthcheckControllerTest.php
index 851bf62e..c0a96ef1 100644
--- a/tests/API/HealthcheckControllerTest.php
+++ b/tests/API/HealthcheckControllerTest.php
@@ -9,6 +9,7 @@
namespace App\Tests\API;
+use App\Constants;
use App\Entity\User;
/**
@@ -31,4 +32,28 @@ class HealthcheckControllerTest extends APIControllerBaseTest
$this->assertInternalType('array', $result);
$this->assertEquals(['message' => 'pong'], $result);
}
+
+ public function testVersion()
+ {
+ $client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
+ $this->assertAccessIsGranted($client, '/api/version');
+ $result = json_decode($client->getResponse()->getContent(), true);
+
+ $this->assertInternalType('array', $result);
+
+ $this->assertArrayHasKey('version', $result);
+ $this->assertArrayHasKey('candidate', $result);
+ $this->assertArrayHasKey('semver', $result);
+ $this->assertArrayHasKey('name', $result);
+ $this->assertArrayHasKey('copyright', $result);
+
+ $this->assertSame(Constants::VERSION, $result['version']);
+ $this->assertEquals(Constants::STATUS, $result['candidate']);
+ $this->assertEquals(Constants::VERSION . '-' . Constants::STATUS, $result['semver']);
+ $this->assertEquals(Constants::NAME, $result['name']);
+ $this->assertEquals(
+ 'Kimai 2 - ' . Constants::VERSION . ' ' . Constants::STATUS . ' (' . Constants::NAME . ') by Kevin Papst and contributors.',
+ $result['copyright']
+ );
+ }
}
diff --git a/tests/Command/VersionCommandTest.php b/tests/Command/VersionCommandTest.php
new file mode 100644
index 00000000..229b5efa
--- /dev/null
+++ b/tests/Command/VersionCommandTest.php
@@ -0,0 +1,67 @@
+application = new Application($kernel);
+
+ $this->application->add(new VersionCommand());
+ }
+
+ /**
+ * @dataProvider getTestData
+ */
+ public function testVersion(array $options, $result)
+ {
+ $commandTester = $this->getCommandTester($options);
+ $output = $commandTester->getDisplay();
+ $this->assertEquals($result . PHP_EOL, $output);
+ }
+
+ public function getTestData()
+ {
+ return [
+ [[], 'Kimai 2 - ' . Constants::VERSION . ' ' . Constants::STATUS . ' (' . Constants::NAME . ') by Kevin Papst and contributors.'],
+ [['--name' => true], Constants::NAME],
+ [['--candidate' => true], Constants::STATUS],
+ [['--short' => true], Constants::VERSION],
+ [['--semver' => true], Constants::VERSION . '-' . Constants::STATUS],
+ ];
+ }
+
+ protected function getCommandTester(array $options = [])
+ {
+ $command = $this->application->find('kimai:version');
+ $commandTester = new CommandTester($command);
+ $inputs = array_merge(['command' => $command->getName()], $options);
+ $commandTester->execute($inputs);
+
+ return $commandTester;
+ }
+}
diff --git a/translations/sidebar.de.xliff b/translations/sidebar.de.xliff
index 21c3ca29..1dc5b0e3 100644
--- a/translations/sidebar.de.xliff
+++ b/translations/sidebar.de.xliff
@@ -4,13 +4,13 @@
home.title
- Kimai v2 - Vorab Version
+ Kimai v2 - %version%home.betainfoKimai.
- Diese neue Version %version% ist aktuell noch in einer frühen Phase der Entwicklung und wurde vorab veröffentlicht, um frühzeitig Rückmeldungen ihrer Benutzer zu sammeln und deren Ideen in die weitere Planung zu integrieren.
+ Diese neue Version ist aktuell noch in einer frühen Phase der Entwicklung und wurde vorab veröffentlicht, um frühzeitig Rückmeldungen ihrer Benutzer zu sammeln und deren Ideen in die weitere Planung zu integrieren.
Um bei der Verbesserung von Kimai zu helfen, schicken Sie mir bitte eine Nachricht auf der verlinkten Webseite. Egal ob Fragen, Fehlermeldungen oder Ideen für Erweiterungen, Ihr Feedback ist wertvoll!
]]>
diff --git a/translations/sidebar.en.xliff b/translations/sidebar.en.xliff
index 36fa9aee..d526e397 100644
--- a/translations/sidebar.en.xliff
+++ b/translations/sidebar.en.xliff
@@ -4,13 +4,13 @@
home.title
- Kimai v2 - Pre-Version
+ Kimai v2 - %version%home.betainfoKimai.
- This new version %version% is currently in an early stage of development and has been published in advance to collect feedback from its users and integrate their ideas into further planning.
+ This new version is currently in an early stage of development and has been published in advance to collect feedback from its users and integrate their ideas into further planning.
To help me improve Kimai, please send your message on the linked website. Whether you have questions, error messages or ideas for enhancements, your feedback is valuable!
]]>
diff --git a/translations/sidebar.es.xliff b/translations/sidebar.es.xliff
index 0ab423cd..ed60b1f7 100644
--- a/translations/sidebar.es.xliff
+++ b/translations/sidebar.es.xliff
@@ -4,13 +4,13 @@
home.title
- Kimai v2 - Pre-Version
+ Kimai v2 - %version%home.betainfoKimai.
- Esta nueva versión %version% se encuentra en una etapa inicial de desarrollo y ha sido publicada con la intención de recolectar feedback de los usuarios para incluir sus ideas en planes futuros..
+ Esta nueva versión se encuentra en una etapa inicial de desarrollo y ha sido publicada con la intención de recolectar feedback de los usuarios para incluir sus ideas en planes futuros..
Para ayudar a mejorar Kimai, por favor enviar sus comentarios al sitio. Sus comentarios, ideas para mejorar o reportes de errores son valiosos y agradezco el tiempo para enviárnoslos!
]]>
diff --git a/translations/sidebar.fr.xliff b/translations/sidebar.fr.xliff
index e9a1148c..6221f5ee 100644
--- a/translations/sidebar.fr.xliff
+++ b/translations/sidebar.fr.xliff
@@ -4,13 +4,13 @@
home.title
- Kimai v2 - Pré-version
+ Kimai v2 - %version%home.betainfoKimai.
- Cette nouvelle version %version% est actuellement à un stade précoce de développement et a été publié à l'avance afin de recueillir les commentaires de ses utilisateurs et d'intégrer leurs idées dans la planification à venir.
+ Cette nouvelle version est actuellement à un stade précoce de développement et a été publié à l'avance afin de recueillir les commentaires de ses utilisateurs et d'intégrer leurs idées dans la planification à venir.
Pour m'aider à améliorerKimai, merci de poster votre message sur le site lié. Que vous ayez des questions, des messages ou des idées d'améliorations, vos retours sont précieux !
]]>
diff --git a/translations/sidebar.it.xliff b/translations/sidebar.it.xliff
index f03b09e7..c0f48ad9 100755
--- a/translations/sidebar.it.xliff
+++ b/translations/sidebar.it.xliff
@@ -4,13 +4,13 @@
home.title
- Kimai v2 - Pre-Version
+ Kimai v2 - %version%home.betainfoKimai.
- This new version %version% is currently in an early stage of development and has been published in advance to collect feedback from its users and integrate their ideas into further planning.
+ This new version is currently in an early stage of development and has been published in advance to collect feedback from its users and integrate their ideas into further planning.
To help me improve Kimai, please send your message on the linked website. Whether you have questions, error messages or ideas for enhancements, your feedback is valuable!
]]>
diff --git a/translations/sidebar.ru.xliff b/translations/sidebar.ru.xliff
index e040f1fb..04e616f7 100644
--- a/translations/sidebar.ru.xliff
+++ b/translations/sidebar.ru.xliff
@@ -4,7 +4,7 @@
home.title
- Kimai v2 - Предварительная версия
+ Kimai v2 - %version%home.betainfo
diff --git a/var/docs/installation.md b/var/docs/installation.md
index c2d92453..2bb3eea4 100644
--- a/var/docs/installation.md
+++ b/var/docs/installation.md
@@ -90,14 +90,14 @@ You just imported demo data, to test the application in its full beauty and with
You can now login with these accounts:
-| Username | Password | Role |
-|---|:---:|---|
-| clara_customer | kitten | Customer |
-| john_user | kitten | User |
-| chris_user | kitten | User (deactivated) |
-| tony_teamlead | kitten | Teamlead |
-| anna_admin | kitten | Administrator |
-| susan_super | kitten | Super-Administrator |
+| Username | Password | API Key | Role |
+|---|:---:|:---:|---|
+| clara_customer| kitten | api_kitten |Customer |
+| john_user| kitten | api_kitten |User |
+| chris_user| kitten | api_kitten |User (deactivated) |
+| tony_teamlead| kitten | api_kitten |Teamlead |
+| anna_admin| kitten | api_kitten |Administrator |
+| susan_super| kitten | api_kitten |Super-Administrator |
Demo data can always be deleted by dropping the schema and re-creating it.
The `kimai:reset-dev` command can always be executed later on to reset your dev database and cache.
diff --git a/var/docs/internal.md b/var/docs/internal.md
index 0da983cc..d9a3da46 100644
--- a/var/docs/internal.md
+++ b/var/docs/internal.md
@@ -6,8 +6,9 @@ Internal documentation for project maintainers
- Prepare a GitHub release-draft
- Change .github_changelog_generator config accordingly to new release tag (increase future release)
+- Change version constants in `src/Constants.php`
- Create CHANGELOG.md with [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator]) by running `github_changelog_generator kevinpapst/kimai2`
-- Push a release branch and add it as last PR merge into master
+- Push a release branch and merge it as last PR into master
- Edit the release-draft and add the "Full changelog" link + everything from CHANGELOG.md related to the new version
- Create the release
- Post a new issue at [YunoHost tracker for Kimai 2](https://github.com/YunoHost-Apps/kimai2_ynh)