зеркало из https://github.com/nextcloud/cookbook.git
Fix the code to allow for pre-releases to not break code base
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Родитель
635aeea330
Коммит
8703b1d226
|
@ -34,7 +34,7 @@ git add package.json
|
|||
echo "Updating version in main controller"
|
||||
version_arr="$major, $minor, $patch"
|
||||
if [ -n "$suffix" ]; then
|
||||
version_arr="$version_arr, -$suffix"
|
||||
version_arr="$version_arr, '-$suffix'"
|
||||
fi
|
||||
sed "/VERSION_TAG/s@[[].*[]]@[$version_arr]@" -i lib/Controller/MainController.php
|
||||
git add lib/Controller/MainController.php
|
||||
|
|
|
@ -97,7 +97,7 @@ class MainController extends Controller {
|
|||
*/
|
||||
public function getApiVersion(): DataResponse {
|
||||
$response = [
|
||||
'cookbook_version' => [0, 9, 14, -beta1], /* VERSION_TAG do not change this line manually */
|
||||
'cookbook_version' => [0, 9, 14, '-beta1'], /* VERSION_TAG do not change this line manually */
|
||||
'api_version' => [
|
||||
'epoch' => 0,
|
||||
'major' => 0,
|
||||
|
|
|
@ -96,11 +96,16 @@ class MainControllerTest extends TestCase {
|
|||
|
||||
public function testGetAPIVersion(): void {
|
||||
$ret = $this->sut->getApiVersion();
|
||||
|
||||
$this->assertEquals(200, $ret->getStatus());
|
||||
|
||||
$retData = $ret->getData();
|
||||
$this->assertTrue(isset($retData['cookbook_version']));
|
||||
$this->assertEquals(3, count($retData['cookbook_version']));
|
||||
$this->assertTrue(count($retData['cookbook_version']) === 3 || count($retData['cookbook_version']) === 4);
|
||||
$this->assertTrue(is_int($retData['cookbook_version'][0]));
|
||||
$this->assertTrue(is_int($retData['cookbook_version'][1]));
|
||||
$this->assertTrue(is_int($retData['cookbook_version'][2]));
|
||||
|
||||
$this->assertTrue(isset($retData['api_version']));
|
||||
$this->assertTrue(isset($retData['api_version']['epoch']));
|
||||
$this->assertTrue(isset($retData['api_version']['major']));
|
||||
|
|
Загрузка…
Ссылка в новой задаче