Skip to content

Commit

Permalink
Merge pull request #32 from ibexa/temp_1.3_to_4.0
Browse files Browse the repository at this point in the history
Merge branch '1.3' of ezsystems/ezplatform-rest into 4.0
  • Loading branch information
ViniTou authored Apr 1, 2022
2 parents 65dc672 + 72e2578 commit 8edddda
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 80 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ jobs:

- name: Run unit test suite
run: composer test
integration-tests:
name: "REST integration tests"
uses: ./.github/workflows/integration-tests-callable.yaml
50 changes: 50 additions & 0 deletions .github/workflows/integration-tests-callable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
workflow_call: ~

env:
APP_ENV: dev
APP_DEBUG: 1
PHP_INI_ENV_memory_limit: 512M
COMPOSER_CACHE_DIR: ~/.composer/cache
PROJECT_VERSION: 4.0.x-dev
PROJECT_EDITION: oss
SETUP: "doc/docker/base-dev.yml:doc/docker/selenium.yml"
WEB_HOST: web

jobs:
integration-tests-rest:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: ${{ env.PROJECT_EDITION }}-${{ env.PROJECT_VERSION }}-${{ github.sha }}
restore-keys: |
${{ env.PROJECT_EDITION }}-${{ env.PROJECT_VERSION }}
- name: Set up whole project using the tested dependency
run: |
curl -L "https://raw.githubusercontent.com/ibexa/ci-scripts/main/bin/${{ env.PROJECT_VERSION }}/prepare_project_edition.sh" > prepare_project_edition.sh
chmod +x prepare_project_edition.sh
./prepare_project_edition.sh ${{ env.PROJECT_EDITION }} ${{ env.PROJECT_VERSION }} ${{ env.SETUP }}
- name: Run setup command
run: |
cd "$HOME/build/project"
docker-compose --env-file=.env exec -T --user www-data app sh -c "APP_ENV=behat php bin/console ibexa:behat:create-language 'pol-PL' 'Polish (polski)'"
- name: Run tests
run: |
cd "$HOME/build/project"
docker-compose --env-file=.env exec -T --user www-data app sh -c "cd vendor/ibexa/rest && composer update && composer integration"
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"scripts": {
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"test": "phpunit -c phpunit.xml"
"test": "phpunit -c phpunit.xml",
"integration": "phpunit -c phpunit-integration-rest.xml"
},
"extra": {
"branch-alias": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
$visitor->setHeader(
'Location',
$this->router->generate(
"ibexa.rest.load_content_type_{$draftUriPart}field_definition",
"ibexa.rest.load_content_type{$draftUriPart}_field_definition",
[
'contentTypeId' => $restFieldDefinition->contentType->id,
'fieldDefinitionId' => $restFieldDefinition->fieldDefinition->id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
$generator->startAttribute(
'href',
$this->router->generate(
'ibexa.rest.load_content_type_' . $urlTypeSuffix . 'field_definition_list',
'ibexa.rest.load_content_type' . $urlTypeSuffix . '_field_definition_list',
[
'contentTypeId' => $contentType->id,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ protected function getUrlTypeSuffix($contentTypeStatus)
{
switch ($contentTypeStatus) {
case Values\ContentType\ContentType::STATUS_DRAFT:
return 'draft_';
return '_draft';
case Values\ContentType\ContentType::STATUS_MODIFIED:
return 'modified_';
return '_modified';
case Values\ContentType\ContentType::STATUS_DEFINED:
default:
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
$generator->startAttribute(
'href',
$this->router->generate(
"ibexa.rest.load_content_type_{$urlTypeSuffix}field_definition",
"ibexa.rest.load_content_type{$urlTypeSuffix}_field_definition",
[
'contentTypeId' => $contentType->id,
'fieldDefinitionId' => $fieldDefinition->id,
Expand Down

0 comments on commit 8edddda

Please sign in to comment.