diff --git a/.github/workflows/browser-tests.yaml b/.github/workflows/browser-tests.yaml index ae067ef9..b97da6e2 100644 --- a/.github/workflows/browser-tests.yaml +++ b/.github/workflows/browser-tests.yaml @@ -3,7 +3,7 @@ name: Browser tests on: push: branches: - - master + - main - '[0-9]+.[0-9]+' pull_request: ~ @@ -13,10 +13,11 @@ jobs: uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main with: project-edition: 'oss' - project-version: '^3.3.x-dev' test-suite: '--profile=browser --suite=admin-ui-full' - test-setup-phase-1: '--profile=setup --suite=personas --mode=standard' - test-setup-phase-2: '--profile=setup --suite=content-translation --mode=standard' + test-setup-phase-1: '--profile=regression --suite=setup-oss --mode=standard' + multirepository: true + timeout: 40 + php-image: "ezsystems/php:8.1-v2-node16" secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} examples: @@ -24,7 +25,6 @@ jobs: uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main with: project-edition: 'oss' - project-version: '^3.3.x-dev' test-suite: '--mode=standard --profile=service --suite=examples' secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 40f9a90d..dc4ec36f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - master + - main - '[0-9]+.[0-9]+' pull_request: ~ @@ -17,7 +17,6 @@ jobs: fail-fast: false matrix: php: - - '7.3' - '7.4' - '8.0' - '8.1' @@ -45,13 +44,13 @@ jobs: - name: Run test suite run: composer run-script --timeout=600 test - cs_fix: + cs-fix: name: Run code style check runs-on: "ubuntu-20.04" strategy: matrix: php: - - "7.3" + - '8.1' steps: - uses: actions/checkout@v2 @@ -60,6 +59,7 @@ jobs: with: php-version: ${{ matrix.php }} coverage: none + extensions: 'pdo_sqlite, gd' tools: cs2pr - uses: "ramsey/composer-install@v1" diff --git a/.gitignore b/.gitignore index 5af0ba5b..90a0d920 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ composer.phar .phpunit.result.cache .php_cs.cache .phpunit.cache +.php-cs-fixer.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 00000000..2823a38a --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,22 @@ +buildConfig() + ->setFinder( + PhpCsFixer\Finder::create() + ->in( + array_filter([ + __DIR__ . '/src', + __DIR__ . '/tests', + ], 'is_dir') + ) + ->files()->name('*.php') + ); diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 4115d463..00000000 --- a/.php_cs +++ /dev/null @@ -1,9 +0,0 @@ -setFinder( - PhpCsFixer\Finder::create() - ->in([__DIR__ . '/src', __DIR__ . '/tests']) - ->files()->name('*.php') - ) -; diff --git a/README.md b/README.md index b0705a25..eeb9ecf9 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ This package is part of [Ibexa DXP](https://ibexa.co). [Install Ibexa DXP](https://doc.ibexa.co/en/latest/install/) and then install this package to use it: ``` -composer require --dev ezsystems/behatbundle --no-scripts --no-plugins -composer sync-recipes ezsystems/behatbundle --force -v +composer require --dev ibexa/behat --no-scripts --no-plugins +composer sync-recipes ibexa/behat --force -v ``` For more information about BehatBundle, see: diff --git a/behat_ibexa_commerce.yaml b/behat_ibexa_commerce.yaml index 25b822d0..75ed85fa 100644 --- a/behat_ibexa_commerce.yaml +++ b/behat_ibexa_commerce.yaml @@ -1,65 +1,62 @@ imports: - behat_ibexa_experience.yaml - - vendor/ezsystems/ezcommerce-admin-ui/behat_suites.yml - - vendor/ezsystems/ezcommerce-shop/behat_suites.yml + - vendor/ibexa/payment/behat_suites.yml regression: suites: setup-commerce: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/personas' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_styles.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_tags.feature' - - '%paths.base%/vendor/ezsystems/ezplatform-workflow/features/setup/setup_experience.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/loginMethods' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/behat/features/personas' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_styles.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_tags.feature' + - '%paths.base%/vendor/ibexa/workflow/features/setup/setup_experience.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/loginMethods' + - '%paths.base%/vendor/ibexa/behat/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/product-catalog/features/setup/setup.feature' + - '%paths.base%/vendor/ibexa/corporate-account/features/setup/setup.feature' contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext - - EzSystems\Behat\Core\Context\ConfigurationContext - - EzSystems\Behat\Core\Context\FileContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext + - Ibexa\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\FileContext + - Ibexa\Migration\Behat\Context\MigrationContext commerce: paths: - - '%paths.base%/vendor/ezsystems/date-based-publisher/features' - - '%paths.base%/vendor/ezsystems/ezcommerce-admin-ui/features/standard' - - '%paths.base%/vendor/ezsystems/ezcommerce-shop/features' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/personas' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/standard' - - '%paths.base%/vendor/ezsystems/ezplatform-form-builder/features' - - '%paths.base%/vendor/ezsystems/ezplatform-page-builder/features/DynamicLandingPage' - - '%paths.base%/vendor/ezsystems/ezplatform-page-builder/features/personas' - - '%paths.base%/vendor/ezsystems/ezplatform-page-fieldtype/features/eventSource' - - '%paths.base%/vendor/ezsystems/ezplatform-user/features/browser' - - '%paths.base%/vendor/ezsystems/ezplatform-segmentation/features' - - '%paths.base%/vendor/ezsystems/ezplatform-workflow/features/browser' - - '%paths.base%/vendor/ezsystems/ezplatform-version-comparison/features' + - '%paths.base%/vendor/ibexa/admin-ui/features/personas' + - '%paths.base%/vendor/ibexa/admin-ui/features/standard' + - '%paths.base%/vendor/ibexa/corporate-account/features/browser' + - '%paths.base%/vendor/ibexa/fieldtype-page/features/eventSource' + - '%paths.base%/vendor/ibexa/form-builder/features' + - '%paths.base%/vendor/ibexa/page-builder/features/DynamicLandingPage' + - '%paths.base%/vendor/ibexa/page-builder/features/personas' + - '%paths.base%/vendor/ibexa/payment/features' + - '%paths.base%/vendor/ibexa/product-catalog/features/browser' + - '%paths.base%/vendor/ibexa/scheduler/features' + - '%paths.base%/vendor/ibexa/segmentation/features' + - '%paths.base%/vendor/ibexa/taxonomy/features' + - '%paths.base%/vendor/ibexa/user/features/browser' + - '%paths.base%/vendor/ibexa/version-comparison/features' + - '%paths.base%/vendor/ibexa/workflow/features/browser' filters: tags: "~@broken&&@IbexaCommerce" contexts: - Behat\MinkExtension\Context\MinkContext - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\TrashContext - - EzSystems\Behat\API\Context\UserContext - Ibexa\AdminUi\Behat\BrowserContext\AdminUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\BookmarkContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext - Ibexa\AdminUi\Behat\BrowserContext\ContentPreviewContext - Ibexa\AdminUi\Behat\BrowserContext\ContentTypeContext - Ibexa\AdminUi\Behat\BrowserContext\ContentUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\ContentViewContext - Ibexa\AdminUi\Behat\BrowserContext\DashboardContext - Ibexa\AdminUi\Behat\BrowserContext\LanguageContext - - Ibexa\AdminUi\Behat\BrowserContext\LeftMenuContext - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext - Ibexa\AdminUi\Behat\BrowserContext\ObjectStatesContext - - Ibexa\AdminUi\Behat\BrowserContext\RightMenuContext - Ibexa\AdminUi\Behat\BrowserContext\RolesContext - Ibexa\AdminUi\Behat\BrowserContext\SearchContext - Ibexa\AdminUi\Behat\BrowserContext\SectionsContext @@ -68,25 +65,38 @@ regression: - Ibexa\AdminUi\Behat\BrowserContext\UDWContext - Ibexa\AdminUi\Behat\BrowserContext\UserNotificationContext - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\TrashContext + - Ibexa\Behat\API\Context\UserContext - Ibexa\Behat\Browser\Context\AuthenticationContext - Ibexa\Behat\Browser\Context\DebuggingContext - - Ibexa\Commerce\ShopTools\Behat\Context\CheckoutContext - - Ibexa\Commerce\ShopTools\Behat\Context\ConfigurationSettingsContext - - Ibexa\Commerce\ShopTools\Behat\Context\FrontContext - - Ibexa\Commerce\ShopTools\Behat\Context\ManageAddressContext - - Ibexa\Commerce\ShopTools\Behat\Context\ProductVariantContext - - Ibexa\Commerce\ShopTools\Behat\Context\UserRegistrationContext + - Ibexa\CorporateAccount\Behat\Context\CompaniesContext - Ibexa\FieldTypePage\Behat\Context\BlockHideEventsSourceContext - Ibexa\FieldTypePage\Behat\Context\BlockRevealEventsSourceContext - Ibexa\FormBuilder\Behat\BrowserContext\FormAdministrationContext - Ibexa\FormBuilder\Behat\BrowserContext\FormBuilderContext - Ibexa\FormBuilder\Behat\BrowserContext\FormFieldConfigurationContext - Ibexa\FormBuilder\Behat\BrowserContext\FormFrontContext + - Ibexa\Migration\Behat\Context\MigrationContext - Ibexa\PageBuilder\Behat\Context\PageBuilderContext + - Ibexa\Payment\Behat\Context\PaymentMethodsContext + - Ibexa\ProductCatalog\Behat\Context\AttributeGroupsContext + - Ibexa\ProductCatalog\Behat\Context\AttributesContext + - Ibexa\ProductCatalog\Behat\Context\CatalogsContext + - Ibexa\ProductCatalog\Behat\Context\CurrenciesContext + - Ibexa\ProductCatalog\Behat\Context\CustomerGroupsContext + - Ibexa\ProductCatalog\Behat\Context\ProductsContext + - Ibexa\ProductCatalog\Behat\Context\ProductTypesContext - Ibexa\Scheduler\Behat\BrowserContext\DateBasedPublisherContext + - Ibexa\Segmentation\Behat\Context\SegmentationContext + - Ibexa\Segmentation\Behat\Context\SegmentationContext + - Ibexa\Taxonomy\Behat\Context\Browser\TaxonomyContext + - Ibexa\Taxonomy\Behat\Context\Service\TaxonomyContext - Ibexa\User\Behat\Context\UserSettingsContext - Ibexa\User\Behat\Context\UserSetupContext - Ibexa\VersionComparison\Behat\Context\VersionComparisonContext - Ibexa\Workflow\Behat\Context\WorkflowAdminContext - Ibexa\Workflow\Behat\Context\WorkflowContext - - Ibexa\Segmentation\Behat\Context\SegmentationContext diff --git a/behat_ibexa_content.yaml b/behat_ibexa_content.yaml index 1dba34ce..aaeeb3e8 100644 --- a/behat_ibexa_content.yaml +++ b/behat_ibexa_content.yaml @@ -1,59 +1,64 @@ imports: - behat_ibexa_oss.yaml - - vendor/ezsystems/date-based-publisher/behat_suites_content.yml - - vendor/ezsystems/ezplatform-workflow/behat_suites_content.yml - - vendor/ezsystems/ezplatform-version-comparison/behat_suites.yml + - vendor/ibexa/product-catalog/behat_suites.yml + - vendor/ibexa/scheduler/behat_suites_content.yml + - vendor/ibexa/taxonomy/behat_suites_content.yml + - vendor/ibexa/version-comparison/behat_suites.yml + - vendor/ibexa/workflow/behat_suites_content.yml regression: suites: setup-content: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/personas' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_styles.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_tags.feature' - - '%paths.base%/vendor/ezsystems/ezplatform-workflow/features/setup/setup_content.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/loginMethods' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/behat/features/personas' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_styles.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_tags.feature' + - '%paths.base%/vendor/ibexa/workflow/features/setup/setup_content.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/loginMethods' + - '%paths.base%/vendor/ibexa/behat/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/product-catalog/features/setup/setup.feature' contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext - - EzSystems\Behat\Core\Context\ConfigurationContext - - EzSystems\Behat\Core\Context\FileContext - - EzSystems\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext + - Ibexa\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\FileContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Migration\Behat\Context\MigrationContext content: paths: - - '%paths.base%/vendor/ezsystems/date-based-publisher/features' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/personas' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/standard' - - '%paths.base%/vendor/ezsystems/ezplatform-user/features/browser' - - '%paths.base%/vendor/ezsystems/ezplatform-workflow/features/browser' - - '%paths.base%/vendor/ezsystems/ezplatform-version-comparison/features' + - '%paths.base%/vendor/ibexa/admin-ui/features/personas' + - '%paths.base%/vendor/ibexa/admin-ui/features/standard' + - '%paths.base%/vendor/ibexa/product-catalog/features/browser' + - '%paths.base%/vendor/ibexa/scheduler/features' + - '%paths.base%/vendor/ibexa/taxonomy/features' + - '%paths.base%/vendor/ibexa/user/features/browser' + - '%paths.base%/vendor/ibexa/version-comparison/features' + - '%paths.base%/vendor/ibexa/workflow/features/browser' filters: tags: "~@broken&&@IbexaContent" contexts: - Behat\MinkExtension\Context\MinkContext - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\TrashContext - - EzSystems\Behat\API\Context\UserContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\TrashContext + - Ibexa\Behat\API\Context\UserContext - Ibexa\AdminUi\Behat\BrowserContext\AdminUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\BookmarkContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext - Ibexa\AdminUi\Behat\BrowserContext\ContentPreviewContext - Ibexa\AdminUi\Behat\BrowserContext\ContentTypeContext - Ibexa\AdminUi\Behat\BrowserContext\ContentUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\ContentViewContext - Ibexa\AdminUi\Behat\BrowserContext\DashboardContext - Ibexa\AdminUi\Behat\BrowserContext\LanguageContext - - Ibexa\AdminUi\Behat\BrowserContext\LeftMenuContext - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext - Ibexa\AdminUi\Behat\BrowserContext\ObjectStatesContext - - Ibexa\AdminUi\Behat\BrowserContext\RightMenuContext - Ibexa\AdminUi\Behat\BrowserContext\RolesContext - Ibexa\AdminUi\Behat\BrowserContext\SearchContext - Ibexa\AdminUi\Behat\BrowserContext\SectionsContext @@ -64,7 +69,17 @@ regression: - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext - Ibexa\Behat\Browser\Context\AuthenticationContext - Ibexa\Behat\Browser\Context\DebuggingContext + - Ibexa\Migration\Behat\Context\MigrationContext + - Ibexa\ProductCatalog\Behat\Context\AttributesContext + - Ibexa\ProductCatalog\Behat\Context\AttributeGroupsContext + - Ibexa\ProductCatalog\Behat\Context\CatalogsContext + - Ibexa\ProductCatalog\Behat\Context\CustomerGroupsContext + - Ibexa\ProductCatalog\Behat\Context\ProductTypesContext + - Ibexa\ProductCatalog\Behat\Context\ProductsContext + - Ibexa\ProductCatalog\Behat\Context\CurrenciesContext - Ibexa\Scheduler\Behat\BrowserContext\DateBasedPublisherContext + - Ibexa\Taxonomy\Behat\Context\Browser\TaxonomyContext + - Ibexa\Taxonomy\Behat\Context\Service\TaxonomyContext - Ibexa\User\Behat\Context\UserSettingsContext - Ibexa\User\Behat\Context\UserSetupContext - Ibexa\VersionComparison\Behat\Context\VersionComparisonContext diff --git a/behat_ibexa_experience.yaml b/behat_ibexa_experience.yaml index 5cac7857..09c99c1b 100644 --- a/behat_ibexa_experience.yaml +++ b/behat_ibexa_experience.yaml @@ -1,68 +1,75 @@ imports: - behat_ibexa_content.yaml - - vendor/ezsystems/date-based-publisher/behat_suites_experience.yml - - vendor/ezsystems/ezplatform-form-builder/behat_suites.yml - - vendor/ezsystems/ezplatform-page-builder/behat_suites.yml - - vendor/ezsystems/ezplatform-page-fieldtype/behat_suites.yml - - vendor/ezsystems/ezplatform-site-factory/behat_suites.yml - - vendor/ezsystems/ezplatform-segmentation/behat_suites.yml - - vendor/ezsystems/ezplatform-workflow/behat_suites_experience.yml + - vendor/ibexa/corporate-account/behat_suites.yml + - vendor/ibexa/fieldtype-page/behat_suites.yml + - vendor/ibexa/form-builder/behat_suites.yml + - vendor/ibexa/page-builder/behat_suites.yml + - vendor/ibexa/scheduler/behat_suites_experience.yml + - vendor/ibexa/segmentation/behat_suites.yml + - vendor/ibexa/site-factory/behat_suites.yml + - vendor/ibexa/taxonomy/behat_suites_experience.yml + - vendor/ibexa/workflow/behat_suites_experience.yml regression: suites: setup-experience: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/personas' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_styles.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_tags.feature' - - '%paths.base%/vendor/ezsystems/ezplatform-workflow/features/setup/setup_experience.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/loginMethods' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/behat/features/personas' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_styles.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_tags.feature' + - '%paths.base%/vendor/ibexa/workflow/features/setup/setup_experience.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/loginMethods' + - '%paths.base%/vendor/ibexa/behat/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/product-catalog/features/setup/setup.feature' + - '%paths.base%/vendor/ibexa/corporate-account/features/setup/setup.feature' contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext - - EzSystems\Behat\Core\Context\ConfigurationContext - - EzSystems\Behat\Core\Context\FileContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext + - Ibexa\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\FileContext + - Ibexa\Migration\Behat\Context\MigrationContext experience: paths: - - '%paths.base%/vendor/ezsystems/date-based-publisher/features' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/personas' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/standard' - - '%paths.base%/vendor/ezsystems/ezplatform-form-builder/features' - - '%paths.base%/vendor/ezsystems/ezplatform-page-builder/features/DynamicLandingPage' - - '%paths.base%/vendor/ezsystems/ezplatform-page-builder/features/personas' - - '%paths.base%/vendor/ezsystems/ezplatform-page-fieldtype/features/eventSource' - - '%paths.base%/vendor/ezsystems/ezplatform-user/features/browser' - - '%paths.base%/vendor/ezsystems/ezplatform-segmentation/features' - - '%paths.base%/vendor/ezsystems/ezplatform-workflow/features/browser' - - '%paths.base%/vendor/ezsystems/ezplatform-version-comparison/features' + - '%paths.base%/vendor/ibexa/admin-ui/features/personas' + - '%paths.base%/vendor/ibexa/admin-ui/features/standard' + - '%paths.base%/vendor/ibexa/corporate-account/features/browser' + - '%paths.base%/vendor/ibexa/fieldtype-page/features/eventSource' + - '%paths.base%/vendor/ibexa/form-builder/features' + - '%paths.base%/vendor/ibexa/page-builder/features/DynamicLandingPage' + - '%paths.base%/vendor/ibexa/page-builder/features/personas' + - '%paths.base%/vendor/ibexa/product-catalog/features/browser' + - '%paths.base%/vendor/ibexa/scheduler/features' + - '%paths.base%/vendor/ibexa/segmentation/features' + - '%paths.base%/vendor/ibexa/taxonomy/features' + - '%paths.base%/vendor/ibexa/user/features/browser' + - '%paths.base%/vendor/ibexa/version-comparison/features' + - '%paths.base%/vendor/ibexa/workflow/features/browser' filters: tags: "~@broken&&@IbexaExperience" contexts: - Behat\MinkExtension\Context\MinkContext - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\TrashContext - - EzSystems\Behat\API\Context\UserContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\TrashContext + - Ibexa\Behat\API\Context\UserContext - Ibexa\AdminUi\Behat\BrowserContext\AdminUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\BookmarkContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext - Ibexa\AdminUi\Behat\BrowserContext\ContentPreviewContext - Ibexa\AdminUi\Behat\BrowserContext\ContentTypeContext - Ibexa\AdminUi\Behat\BrowserContext\ContentUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\ContentViewContext - Ibexa\AdminUi\Behat\BrowserContext\DashboardContext - Ibexa\AdminUi\Behat\BrowserContext\LanguageContext - - Ibexa\AdminUi\Behat\BrowserContext\LeftMenuContext - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext - Ibexa\AdminUi\Behat\BrowserContext\ObjectStatesContext - - Ibexa\AdminUi\Behat\BrowserContext\RightMenuContext - Ibexa\AdminUi\Behat\BrowserContext\RolesContext - Ibexa\AdminUi\Behat\BrowserContext\SearchContext - Ibexa\AdminUi\Behat\BrowserContext\SectionsContext @@ -73,14 +80,25 @@ regression: - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext - Ibexa\Behat\Browser\Context\AuthenticationContext - Ibexa\Behat\Browser\Context\DebuggingContext + - Ibexa\CorporateAccount\Behat\Context\CompaniesContext - Ibexa\FieldTypePage\Behat\Context\BlockHideEventsSourceContext - Ibexa\FieldTypePage\Behat\Context\BlockRevealEventsSourceContext - Ibexa\FormBuilder\Behat\BrowserContext\FormAdministrationContext - Ibexa\FormBuilder\Behat\BrowserContext\FormBuilderContext - Ibexa\FormBuilder\Behat\BrowserContext\FormFieldConfigurationContext - Ibexa\FormBuilder\Behat\BrowserContext\FormFrontContext + - Ibexa\Migration\Behat\Context\MigrationContext - Ibexa\PageBuilder\Behat\Context\PageBuilderContext + - Ibexa\ProductCatalog\Behat\Context\AttributesContext + - Ibexa\ProductCatalog\Behat\Context\AttributeGroupsContext + - Ibexa\ProductCatalog\Behat\Context\CatalogsContext + - Ibexa\ProductCatalog\Behat\Context\CustomerGroupsContext + - Ibexa\ProductCatalog\Behat\Context\ProductTypesContext + - Ibexa\ProductCatalog\Behat\Context\ProductsContext + - Ibexa\ProductCatalog\Behat\Context\CurrenciesContext - Ibexa\Scheduler\Behat\BrowserContext\DateBasedPublisherContext + - Ibexa\Taxonomy\Behat\Context\Browser\TaxonomyContext + - Ibexa\Taxonomy\Behat\Context\Service\TaxonomyContext - Ibexa\User\Behat\Context\UserSettingsContext - Ibexa\User\Behat\Context\UserSetupContext - Ibexa\VersionComparison\Behat\Context\VersionComparisonContext diff --git a/behat_ibexa_oss.yaml b/behat_ibexa_oss.yaml index 3046b7ad..e7593c2b 100644 --- a/behat_ibexa_oss.yaml +++ b/behat_ibexa_oss.yaml @@ -1,10 +1,10 @@ imports: - - vendor/ezsystems/behatbundle/behat_suites.yml - - vendor/ezsystems/ezplatform-admin-ui/behat_suites.yml - - vendor/ezsystems/ezplatform-content-forms/behat_suites.yml - - vendor/ezsystems/ezplatform-http-cache/behat_suites.yml - - vendor/ezsystems/ezplatform-kernel/eZ/Bundle/EzPublishCoreBundle/behat_suites.yml - - vendor/ezsystems/ezplatform-user/behat_suites.yml + - vendor/ibexa/behat/behat_suites.yml + - vendor/ibexa/admin-ui/behat_suites.yml + - vendor/ibexa/content-forms/behat_suites.yml + - vendor/ibexa/http-cache/behat_suites.yml + - vendor/ibexa/core/src/bundle/Core/behat_suites.yaml + - vendor/ibexa/user/behat_suites.yml default: calls: @@ -15,21 +15,19 @@ default: pretty: true extensions: Behat\MinkExtension: - files_path: '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/src/lib/Behat/TestFiles/' + files_path: '%paths.base%/vendor/ibexa/admin-ui/src/lib/Behat/TestFiles/' base_url: '%env(string:WEB_HOST)%' goutte: ~ javascript_session: 'selenium' sessions: selenium: - selenium2: + webdriver: browser: chrome wd_host: '%env(string:SELENIUM_HOST)%' capabilities: extra_capabilities: - chromeOptions: - w3c: false + goog:chromeOptions: args: - - "--window-size=1440,1080" - "--no-sandbox" # problem with different iframe host - https://bugs.chromium.org/p/chromedriver/issues/detail?id=2758 - "--disable-features=site-per-process" @@ -40,14 +38,18 @@ default: chrome: api_url: '%env(string:CHROMIUM_HOST)%' + OAndreyev\MinkPhpWebdriverExtension: ~ + DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~ FriendsOfBehat\SymfonyExtension: bootstrap: 'tests/bootstrap.php' - EzSystems\BehatBundle\BehatExtension: + Ibexa\Bundle\Behat\IbexaExtension: mink: default_javascript_session: '%env(string:MINK_DEFAULT_SESSION)%' + width: 1440 + height: 1080 Liuggio\Fastest\Behat\ListFeaturesExtension\Extension: ~ @@ -67,47 +69,47 @@ regression: suites: setup-oss: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/personas' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_styles.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_tags.feature' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/loginMethods' - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/behat/features/personas' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_styles.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/richtextConfiguration/custom_tags.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/loginMethods' + - '%paths.base%/vendor/ibexa/behat/features/setup/contentTranslation' contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext - - EzSystems\Behat\Core\Context\ConfigurationContext - - EzSystems\Behat\Core\Context\FileContext - - EzSystems\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext + - Ibexa\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\FileContext + - Ibexa\Behat\API\Context\LanguageContext oss: paths: - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/personas' - - '%paths.base%/vendor/ezsystems/ezplatform-admin-ui/features/standard' - - '%paths.base%/vendor/ezsystems/ezplatform-user/features/browser' + - '%paths.base%/vendor/ibexa/admin-ui/features/personas' + - '%paths.base%/vendor/ibexa/admin-ui/features/standard' + - '%paths.base%/vendor/ibexa/user/features/browser' filters: tags: "~@broken&&@IbexaOSS" contexts: - Behat\MinkExtension\Context\MinkContext - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\TrashContext - - EzSystems\Behat\API\Context\UserContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\TrashContext + - Ibexa\Behat\API\Context\UserContext - Ibexa\AdminUi\Behat\BrowserContext\AdminUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\BookmarkContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext - Ibexa\AdminUi\Behat\BrowserContext\ContentPreviewContext - Ibexa\AdminUi\Behat\BrowserContext\ContentTypeContext - Ibexa\AdminUi\Behat\BrowserContext\ContentUpdateContext - Ibexa\AdminUi\Behat\BrowserContext\ContentViewContext - Ibexa\AdminUi\Behat\BrowserContext\DashboardContext - Ibexa\AdminUi\Behat\BrowserContext\LanguageContext - - Ibexa\AdminUi\Behat\BrowserContext\LeftMenuContext - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext - Ibexa\AdminUi\Behat\BrowserContext\ObjectStatesContext - - Ibexa\AdminUi\Behat\BrowserContext\RightMenuContext - Ibexa\AdminUi\Behat\BrowserContext\RolesContext - Ibexa\AdminUi\Behat\BrowserContext\SearchContext - Ibexa\AdminUi\Behat\BrowserContext\SectionsContext @@ -116,7 +118,6 @@ regression: - Ibexa\AdminUi\Behat\BrowserContext\UDWContext - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext - Ibexa\Behat\Browser\Context\AuthenticationContext - - Ibexa\User\Behat\Context\UserSettingsContext - Ibexa\Behat\Browser\Context\DebuggingContext + - Ibexa\User\Behat\Context\UserSettingsContext - Ibexa\User\Behat\Context\UserSetupContext - - EzSystems\Behat\API\Context\RoleContext diff --git a/behat_suites.yml b/behat_suites.yml index 0a4176c1..d6989ae4 100644 --- a/behat_suites.yml +++ b/behat_suites.yml @@ -2,87 +2,87 @@ service: suites: examples: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/examples' + - '%paths.base%/vendor/ibexa/behat/features/examples' contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\ObjectStateContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\ObjectStateContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext + - Ibexa\Behat\Core\Context\ConfigurationContext setup: suites: volume-testing: paths: - - vendor/ezsystems/behatbundle/features/setup/volume/ + - vendor/ibexa/behat/features/setup/volume/ contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext richtext-configuration: paths: - - vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_tags.feature - - vendor/ezsystems/behatbundle/features/setup/richtextConfiguration/custom_styles.feature + - vendor/ibexa/behat/features/setup/richtextConfiguration/custom_tags.feature + - vendor/ibexa/behat/features/setup/richtextConfiguration/custom_styles.feature contexts: - - EzSystems\Behat\Core\Context\ConfigurationContext - - EzSystems\Behat\Core\Context\FileContext + - Ibexa\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\FileContext personas: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/personas' + - '%paths.base%/vendor/ibexa/behat/features/personas' contexts: - - EzSystems\Behat\API\Context\ContentContext - - EzSystems\Behat\API\Context\ContentTypeContext - - EzSystems\Behat\API\Context\RoleContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\API\Context\UserContext + - Ibexa\Behat\API\Context\ContentContext + - Ibexa\Behat\API\Context\ContentTypeContext + - Ibexa\Behat\API\Context\RoleContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\API\Context\UserContext URIElement: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/siteaccessMatcher/URIElement.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/siteaccessMatcher/URIElement.feature' contexts: - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\Core\Context\ConfigurationContext MapHost: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/siteaccessMatcher/MapHost.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/siteaccessMatcher/MapHost.feature' contexts: - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\Core\Context\ConfigurationContext MapURI: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/siteaccessMatcher/MapURI.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/siteaccessMatcher/MapURI.feature' contexts: - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\Core\Context\ConfigurationContext CompoundMapURIMapHost: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/siteaccessMatcher/CompoundMapURIMapHost.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/siteaccessMatcher/CompoundMapURIMapHost.feature' contexts: - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\TestContext - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\TestContext + - Ibexa\Behat\Core\Context\ConfigurationContext multirepository: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/multirepository' + - '%paths.base%/vendor/ibexa/behat/features/setup/multirepository' contexts: - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\ConfigurationContext login-methods: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/loginMethods' + - '%paths.base%/vendor/ibexa/behat/features/setup/loginMethods' contexts: - - EzSystems\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\Core\Context\ConfigurationContext content-translation: paths: - - '%paths.base%/vendor/ezsystems/behatbundle/features/setup/contentTranslation' + - '%paths.base%/vendor/ibexa/behat/features/setup/contentTranslation' contexts: - - EzSystems\Behat\Core\Context\ConfigurationContext - - EzSystems\Behat\API\Context\LanguageContext - - EzSystems\Behat\API\Context\TestContext + - Ibexa\Behat\Core\Context\ConfigurationContext + - Ibexa\Behat\API\Context\LanguageContext + - Ibexa\Behat\API\Context\TestContext diff --git a/bin/.travis/trigger_ci.sh b/bin/.travis/trigger_ci.sh deleted file mode 100755 index b271867d..00000000 --- a/bin/.travis/trigger_ci.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash - -# Run a regression build on Travis using multiple dependencies (Pull Requests) -# -# How to use: -# - run the script in "behat" Symfony environment -# - specify the number of Pull Requests and paste GitHub links to them -# -# Requires GitHub CLI tool ("hub"): https://github.com/github/hub - -set -e - -if [ "$APP_ENV" != "behat" ]; then - echo 'Please run the script in "behat" Symfony env.' - echo 'You can run "export APP_ENV=behat" in the command line to achieve it.' - echo 'Aborted.' - exit 1 -fi - -if ! [ -x "$(command -v hub)" ]; then - echo '"hub" command is not available.' - echo 'Install the GitHub CLI client by going to https://github.com/github/hub and rerun the script.' - echo "If you're accessing your remotes using https, please configure hub running: git config --global hub.protocol https" - echo 'Aborted.' - exit 1 -fi - -# Step 0: Setup variables -CONST_RANDOM_STRING=$(uuidgen) -prLinks=() -composerDependencyStrings=() -REPOSITORY_URLS=() -GITHUB_OAUTH_TOKEN=$(composer config github-oauth.github.com --global) -TARGET_METAREPOSITORY_BRANCH="" -TARGET_PAGE_BUILDER_BRANCH="" -HAS_PAGE_BUILDER_DEPENDENCY=0 -UNDEFINED_VALUE="undefined" - -# Step 1: ask for number of PRs and a link for each PR - -read -p 'Number of pull requests: ' numberOfDependencies - -for ((n=0;n<$numberOfDependencies;n++)); do - read -p 'Pull request link: ' link - prLinks+=("$link") -done - -echo 'Adding dependencies to Composer...' - -# Step 2: Parse data from the Pull Request -for i in "${prLinks[@]}" -do - read -r -a VALUES <<< "$(php bin/console ibexa:behat:get-pull-request-data $i $GITHUB_OAUTH_TOKEN)" - - REPOSITORY_URLS+=("${VALUES[0]}") - - BRANCH_NAME="${VALUES[1]}" - BRANCH_ALIAS="${VALUES[2]}" - REPOSITORY_NAME="${VALUES[3]}" - - if [ "${REPOSITORY_NAME}" == "ezplatform-page-builder" ] ; then - # We need to detect Page Builder because the regression is run by creating a PR in that repo - if there is a PR already we don't need to create a new one - HAS_PAGE_BUILDER_DEPENDENCY=1 - PAGE_BUILDER_PR_BRANCH=$BRANCH_NAME - elif [ "${HAS_PAGE_BUILDER_DEPENDENCY}" == 0 ]; then - # If Page Builder dependency has been detected for earlier links do not overwrite it - PAGE_BUILDER_PR_BRANCH=$CONST_RANDOM_STRING - fi - - composerDependencyString=$(printf "ezsystems/%s:dev-%s as %s" $REPOSITORY_NAME $BRANCH_NAME $BRANCH_ALIAS) - composerDependencyStrings+=("$composerDependencyString") - - PARSED_PR_METAREPOSITORY_BRANCH="${VALUES[4]}" - PARSED_PR_PAGE_BUILDER_BRANCH="${VALUES[5]}" - - if [ "${PARSED_PR_METAREPOSITORY_BRANCH}" != "${UNDEFINED_VALUE}" ] ; then - TARGET_METAREPOSITORY_BRANCH=$PARSED_PR_METAREPOSITORY_BRANCH - fi - - if [ "${PARSED_PR_PAGE_BUILDER_BRANCH}" != "${UNDEFINED_VALUE}" ] ; then - TARGET_PAGE_BUILDER_BRANCH=$PARSED_PR_PAGE_BUILDER_BRANCH - fi -done - -if [ "${TARGET_METAREPOSITORY_BRANCH}" == "" ] || [ "${TARGET_PAGE_BUILDER_BRANCH}" == "" ] ; then - echo 'Could not determine target metarepository or Page Builder branch. Aborting.' - exit 1 -fi - -# Step 3: Prepare ezplatfom-ee repository -rm -rf regression_setup -mkdir -p regression_setup && cd regression_setup -hub clone --quiet ezsystems/ezplatform-ee -b $TARGET_METAREPOSITORY_BRANCH -cd ezplatform-ee -git remote remove origin 2> /dev/null -METAREPOSITORY_BRANCH_NAME=$CONST_RANDOM_STRING -git checkout -b $METAREPOSITORY_BRANCH_NAME --quiet - -# Step 4: Execute Composer commands in ezplatform-ee - -for i in "${REPOSITORY_URLS[@]}" -do - composer config repositories.$(uuidgen) vcs "$i" -done - -for i in "${composerDependencyStrings[@]}" -do - printf "Adding dependency: %s\n" "$i" - composer require --no-update --no-progress --no-scripts "$i" -done - -echo -e 'Dependencies have been added \033[0;32m✔\033[0m' - -# Step 5: Push the metarepo - -echo 'Preparing metarepository branch...' -git add composer.json -git commit -m "[Travis] Added dependencies" --quiet -hub remote add regression-remote mnocon/ezplatform-ee -git push --set-upstream regression-remote $METAREPOSITORY_BRANCH_NAME --quiet > /dev/null -cd .. - -echo -e 'Prepared a branch with dependencies using ezplatform-ee repository \033[0;32m✔\033[0m' - -## Step 6: Clone Page Builder repository - -if [ "${HAS_PAGE_BUILDER_DEPENDENCY}" == 1 ] ; then - # If there is a Page Builder dependency then we need to add a commit there, not to a new branch - hub clone --quiet ezsystems/ezplatform-page-builder -b $PAGE_BUILDER_PR_BRANCH - cd ezplatform-page-builder -else - # Without an existing Page Builder branch we base a new branch on the target branch - hub clone --quiet ezsystems/ezplatform-page-builder -b $TARGET_PAGE_BUILDER_BRANCH - cd ezplatform-page-builder - git checkout -b $PAGE_BUILDER_PR_BRANCH --quiet || exit 1 - git branch -D $TARGET_PAGE_BUILDER_BRANCH --quiet || exit 1 -fi - -# Step 7: Prepare a commit in Page Builder - -sed -i.bak -e 's/https:\/\/github.com\/ezsystems\/ezplatform-ee.git/https:\/\/github.com\/mnocon\/ezplatform-ee.git/g' .travis.yml -composer config extra._ezplatform_branch_for_behat_tests $METAREPOSITORY_BRANCH_NAME -git add composer.json .travis.yml -git commit -m "[TMP] Run regression" --quiet - -# Step 8: Push to Page Builder. Open existing PR or create a new one -printf "About to push in Page Builder to branch \033[1;32m%s\033[0m\n" "$(git rev-parse --abbrev-ref HEAD)" -if [ "${HAS_PAGE_BUILDER_DEPENDENCY}" == 1 ] ; then - echo -e "\033[1;33mThis is an existing branch that contains work done by someone else.\033[0m" - echo -e "\033[1;33mRemember to talk with them that you are adding a commit to their branch and clearly mark the Pull Request as one containing temporary changes.\033[0m" -fi -read -p "Do you want to continue? [y/N]:" -r -if [[ ! $REPLY =~ ^[Yy] ]] ; then - echo -e '\033[0;31mAborted.\033[0m' - exit 1 -fi - -# Push to Page Builder -git push --set-upstream origin $PAGE_BUILDER_PR_BRANCH --quiet > /dev/null -echo -e 'Pushed to Page Builder repository \033[0;32m✔\033[0m' - -if [ "${HAS_PAGE_BUILDER_DEPENDENCY}" == 1 ] ; then - # Open existing PR - echo -e '\033[1;33mOpening existing Pull Request. Remember to indicate that it contains temporary commit.\033[0m' - hub pr show -else - # Without an existing Page Builder branch we need to create a new PR - hub pull-request -b $TARGET_PAGE_BUILDER_BRANCH -m "[DON'T MERGE] Running regression tests" -m "Add your description here." -l "Work in progress" --browse - echo -e 'Prepared a Pull Request in Page Builder triggering the build \033[0;32m✔\033[0m' -fi - -echo -e 'Script finished \033[0;32m✔\033[0m' diff --git a/composer.json b/composer.json index df5ab005..a47043df 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,12 @@ { - "name": "ezsystems/behatbundle", - "description": "Behat bundle for help testing eZ Bundles and projects", + "name": "ibexa/behat", + "description": "Ibexa Behat", "license": "GPL-2.0", - "authors": [ - { - "name": "eZ Publish dev-team & eZ Community", - "homepage": "https://github.com/ezsystems/BehatBundle" - } - ], + "replace": { + "ezsystems/behatbundle": "*" + }, "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "ext-json": "*", "behat/behat": "^3.11", "behat/mink-goutte-driver": "^1.2", @@ -18,15 +15,15 @@ "dmore/behat-chrome-extension": "^1.3", "dmore/chrome-mink-driver": "^2.7", "ezsystems/behat-screenshot-image-driver-cloudinary": "^1.1@dev", - "ezsystems/ezplatform-http-cache": "^2.3@dev", - "ezsystems/ezplatform-kernel": "^1.3@dev", + "ibexa/http-cache": "~4.5.0@dev", + "ibexa/core": "~4.5.0@dev", "friends-of-behat/mink": "^1.8", "friends-of-behat/mink-browserkit-driver": "^1.4", "friends-of-behat/mink-extension": "^2.4", "friends-of-behat/symfony-extension": "^2.1", "fakerphp/faker": "^1.17", "guzzlehttp/psr7": "^1.6.1", - "liuggio/fastest": "^1.7", + "liuggio/fastest": "^1.11", "php-http/client-common": "^2.1", "phpunit/phpunit": "^8.5 || ^9.0 || ^10.0", "symfony/config": "^5.0", @@ -37,20 +34,23 @@ "symfony/process": "^5.4", "symfony/property-access": "^5.0", "symfony/yaml": "^5.0", - "psy/psysh": "^0.10.8" + "psy/psysh": "^0.10.8", + "oleg-andreyev/mink-phpwebdriver": "^1.2", + "oleg-andreyev/mink-phpwebdriver-extension": "^1.0" }, "require-dev": { - "ibexa/ci-scripts": "^0.1@dev", - "ezsystems/doctrine-dbal-schema": "^1.0@dev", - "ezsystems/ezplatform-code-style": "^1.0.0", - "ezsystems/ezplatform-rest": "^1.3@dev", - "friendsofphp/php-cs-fixer": "^2.16.0", + "ibexa/code-style": "^1.0", + "friendsofphp/php-cs-fixer": "^3.0", + "ibexa/ci-scripts": "^0.2@dev", + "ibexa/doctrine-schema": "~4.5.0@dev", + "ibexa/rest": "~4.5.0@dev", "mikey179/vfsstream": "^1.6" }, "autoload": { "psr-4": { - "Ibexa\\Bundle\\Behat\\": "src/bundle/", "Ibexa\\Behat\\": "src/lib/", + "Ibexa\\Bundle\\Behat\\": "src/bundle/", + "Ibexa\\Contracts\\Behat\\": "src/contracts/", "EzSystems\\BehatBundle\\": "src/bundle/", "EzSystems\\Behat\\": "src/lib/" } @@ -60,17 +60,19 @@ }, "autoload-dev": { "psr-4": { + "Ibexa\\Tests\\Behat\\": "tests/lib/", + "Ibexa\\Tests\\Bundle\\Behat\\": "tests/bundle/", "EzSystems\\Behat\\Test\\": "tests/" } }, "scripts": { - "fix-cs": "php-cs-fixer fix -v --show-progress=estimating", + "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" }, "extra": { "branch-alias": { - "dev-master": "8.3.x-dev" + "dev-main": "4.5.x-dev" } }, "bin": ["bin/ibexabehat"], diff --git a/doc/features.md b/doc/features.md index 832dd566..0effed54 100644 --- a/doc/features.md +++ b/doc/features.md @@ -3,7 +3,7 @@ ## Example usages ### API examples -See [BehatBundle examples](https://github.com/ezsystems/BehatBundle/tree/master/features/examples) to see how to use Behat sentences to: +See [BehatBundle examples](https://github.com/ibexa/behat/tree/master/features/examples) to see how to use Behat sentences to: - create Languages, Content items, Content Types - create Users with complex permissions - create given YAML configuration @@ -28,11 +28,11 @@ Before you start using that you need to inject the [drag-mock script](../Resourc ### SiteAccess awareness -With `EzBehatExtension` enabled Behat becomes SiteAccess aware. The SiteAccess used can be specified using `EZPLATFORM_SITEACCESS` environment variable, otherwise the default SiteAccess will be used. +With `IbexaExtension` enabled Behat becomes SiteAccess aware. The SiteAccess used can be specified using `IBEXA_SITEACCESS` environment variable, otherwise the default SiteAccess will be used. ## Debugging tools -Use the `Ibexa\Behat\Browser\Context\Hooks` Context class to access browser and server logs after Scenario failure, which combined with the screenshots feature makes debugging failures (even on CI) much easier. +Use the `Ibexa\Behat\Browser\Context\DebuggingContext` Context class to access browser and server logs after Scenario failure, which combined with the screenshots feature makes debugging failures (even on CI) much easier. ## Default testing configuration diff --git a/features/examples/configuration.feature b/features/examples/configuration.feature index 664917f8..b7500455 100644 --- a/features/examples/configuration.feature +++ b/features/examples/configuration.feature @@ -11,7 +11,7 @@ Feature: Example scenarios showing how to set configuration | languages | pol-PL | Scenario: Configure Varnish as http cache - Given I set configuration to "ezplatform.http_cache" + Given I set configuration to "ibexa.http_cache" """ purge_type: 'varnish' """ diff --git a/features/examples/content.feature b/features/examples/content.feature index f8eb8094..180bf787 100644 --- a/features/examples/content.feature +++ b/features/examples/content.feature @@ -81,9 +81,9 @@ Feature: Example scenarios showing how to use steps involving Languages, Content | Date and time CT2 | DateAndTimeCT2 | Date and time | 2018-12-31 13:55:00 | | | Content relation CT2 | ContentRelationCT2 | Content relation (single) | /RelationFolder1 | | | Content relations CT2 | ContentRelationsCT2 | Content relations (multiple) | RelationFolder1,/RelationFolder2 | | - | Image CT2 | ImageCT2 | Image | vendor/ezsystems/behatbundle/src/lib/Data/Images/small1.jpg | | - | File CT2 | FileCT2 | File | vendor/ezsystems/behatbundle/src/lib/Data/Files/file1.txt | | - | Media CT2 | MediaCT2 | Media | vendor/ezsystems/behatbundle/src/lib/Data/Videos/video1.mp4 | | + | Image CT2 | ImageCT2 | Image | vendor/ibexa/behat/src/lib/Data/Images/small1.jpg | | + | File CT2 | FileCT2 | File | vendor/ibexa/behat/src/lib/Data/Files/file1.txt | | + | Media CT2 | MediaCT2 | Media | vendor/ibexa/behat/src/lib/Data/Videos/video1.mp4 | | | Matrix CT2 | MatrixCT2 | Matrix | col1:col2:col3,Ala:miała:kota,Szpak:dziobał:bociana,Bociana:dziobał:szpak | Min_rows:2,Columns:col1-col2-col3 | | Selection CT2 | SelectionCT2 | Selection | 1,2 | is_multiple:true,options:Option1-Option2-Option3 | | Image Asset CT2 | ImageAssetCT2 | Image Asset | /Media/Images/ImageForImageAsset | | diff --git a/features/personas/subtree_editor.feature b/features/personas/subtree_editor.feature index b44966a0..cf52df4b 100644 --- a/features/personas/subtree_editor.feature +++ b/features/personas/subtree_editor.feature @@ -44,8 +44,8 @@ Feature: Editor that has access only to a Subtree of Content Structure | content | reverserelatedlist | And I create a role "ReadNodesForSubtreeEditors" And I add policy "content" "read" to "ReadNodesForSubtreeEditors" with limitations - | limitationType | limitationValue | - | Location | root,/FolderGrandParent | + | limitationType | limitationValue | + | Location | root,/FolderGrandParent,/taxonomy/tags/root | And I add policy "content" "versionread" to "ReadNodesForSubtreeEditors" with limitations | limitationType | limitationValue | | Location | root,/FolderGrandParent | diff --git a/features/setup/contentTranslation/language_configuration.feature b/features/setup/contentTranslation/language_configuration.feature index f2cdb500..6479c420 100644 --- a/features/setup/contentTranslation/language_configuration.feature +++ b/features/setup/contentTranslation/language_configuration.feature @@ -3,6 +3,6 @@ Feature: Language configuration for testing translations @admin @setup @translation Scenario: Add French language. Add it to admin panel configuration. Given Language "French" with code "fre-FR" exists - And I append configuration to "admin_group" siteaccess in "config/packages/ezplatform_admin_ui.yaml" + And I append configuration to "admin_group" siteaccess in "config/packages/ibexa_admin_ui.yaml" | key | value | | languages | fre-FR | diff --git a/features/setup/loginMethods/email_provider.feature b/features/setup/loginMethods/email_provider.feature index d9e219bc..eec75f6b 100644 --- a/features/setup/loginMethods/email_provider.feature +++ b/features/setup/loginMethods/email_provider.feature @@ -1,19 +1,20 @@ Feature: Email provider setup for testing + @test Scenario: Set up both username and email providers - Given I set configuration to "security.providers.ezplatform" in "config/packages/security.yaml" + Given I set configuration to "security.providers.ibexa" in "config/packages/security.yaml" """ chain: - providers: [ ezplatform_email, ezplatform_username ] + providers: [ ibexa_email, ibexa_username ] """ And I append configuration to "security.providers" in "config/packages/security.yaml" """ - ezplatform_email: - id: ezpublish.security.user_provider.email - ezplatform_username: - id: ezpublish.security.user_provider.username + ibexa_email: + id: Ibexa\Core\MVC\Symfony\Security\User\EmailProvider + ibexa_username: + id: Ibexa\Core\MVC\Symfony\Security\User\UsernameProvider """ - And I append configuration to "security.firewalls.ezpublish_front" in "config/packages/security.yaml" + And I append configuration to "security.firewalls.ibexa_front" in "config/packages/security.yaml" """ - provider: ezplatform + provider: ibexa """ diff --git a/features/setup/multirepository/multirepository.feature b/features/setup/multirepository/multirepository.feature index 819e8896..9a4ff5f0 100644 --- a/features/setup/multirepository/multirepository.feature +++ b/features/setup/multirepository/multirepository.feature @@ -11,14 +11,14 @@ Feature: Multirepository setup for testing second_connection: url: '%env(resolve:DATABASE_URL)%' """ - And I set configuration to "ezplatform.repositories.new_repository" + Given I copy the configuration from "ibexa.repositories.default" to "ibexa.repositories.new_repository" + And I append configuration to "ibexa.repositories.new_repository.storage" """ - storage: - engine: 'legacy' - connection: second_connection - config: {} - search: - connection: second_connection + connection: second_connection + """ + And I append configuration to "ibexa.repositories.new_repository.search" + """ + connection: second_connection """ And I set configuration to "admin_group" siteaccess | key | value | diff --git a/features/setup/richtextConfiguration/custom_styles.feature b/features/setup/richtextConfiguration/custom_styles.feature index 3a263d34..26608b29 100644 --- a/features/setup/richtextConfiguration/custom_styles.feature +++ b/features/setup/richtextConfiguration/custom_styles.feature @@ -2,31 +2,31 @@ Feature: Example scenarios showing how to set custom styles configuration Scenario: Add Highlighted Block custom styles configuration - Given I "append" configuration to "ezrichtext.custom_styles" + Given I "append" configuration to "ibexa_fieldtype_richtext.custom_styles" """ highlighted_block_test: - template: '@ezdesign/field_type/ezrichtext/custom_style/highlighted_block.html.twig' + template: '@ibexadesign/field_type/ibexa_fieldtype_richtext/custom_style/highlighted_block.html.twig' inline: false """ And I "append" configuration to "default" siteaccess under "fieldtypes.ezrichtext.custom_styles" key """ highlighted_block_test """ - And I create a file "templates/themes/standard/field_type/ezrichtext/custom_style/highlighted_block.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_block.html.twig" - And I create a file "templates/themes/admin/field_type/ezrichtext/custom_style/highlighted_block.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_block.html.twig" + And I create a file "templates/themes/standard/field_type/ibexa_fieldtype_richtext/custom_style/highlighted_block.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_block.html.twig" + And I create a file "templates/themes/admin/field_type/ibexa_fieldtype_richtext/custom_style/highlighted_block.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_block.html.twig" And I create a file "translations/custom_styles.en.yaml" with content from "Files/Richtext/CustomStyle/translations/highlighted_block.en.yaml" Scenario: Add Highlighted Word custom styles configuration - Given I "append" configuration to "ezrichtext.custom_styles" + Given I "append" configuration to "ibexa_fieldtype_richtext.custom_styles" """ highlighted_word_test: - template: '@ezdesign/field_type/ezrichtext/custom_style/highlighted_word.html.twig' + template: '@ibexadesign/field_type/ibexa_fieldtype_richtext/custom_style/highlighted_word.html.twig' inline: true """ And I "append" configuration to "default" siteaccess under "fieldtypes.ezrichtext.custom_styles" key """ highlighted_word_test """ - And I create a file "templates/themes/standard/field_type/ezrichtext/custom_style/highlighted_word.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_word.html.twig" - And I create a file "templates/themes/admin/field_type/ezrichtext/custom_style/highlighted_word.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_word.html.twig" - And I append to "translations/custom_styles.en.yaml" file "Files/Richtext/CustomStyle/translations/highlighted_word.en.yaml" \ No newline at end of file + And I create a file "templates/themes/standard/field_type/ibexa_fieldtype_richtext/custom_style/highlighted_word.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_word.html.twig" + And I create a file "templates/themes/admin/field_type/ibexa_fieldtype_richtext/custom_style/highlighted_word.html.twig" with content from "Files/Richtext/CustomStyle/twig/highlighted_word.html.twig" + And I append to "translations/custom_styles.en.yaml" file "Files/Richtext/CustomStyle/translations/highlighted_word.en.yaml" diff --git a/features/setup/richtextConfiguration/custom_tags.feature b/features/setup/richtextConfiguration/custom_tags.feature index 48a0eccf..06b56d92 100644 --- a/features/setup/richtextConfiguration/custom_tags.feature +++ b/features/setup/richtextConfiguration/custom_tags.feature @@ -2,11 +2,11 @@ Feature: Example scenarios showing how to set custom tags configuration Scenario: Add YouTube custom tag configuration - Given I "append" configuration to "ezrichtext.custom_tags" + Given I "append" configuration to "ibexa_fieldtype_richtext.custom_tags" """ ezyoutube_test: # The template used for front-end rendering of the custom tag - template: field_type/ezrichtext/custom_tag/ezyoutube.html.twig + template: field_type/ibexa_fieldtype_richtext/custom_tag/ezyoutube.html.twig # An icon for the custom tag as displayed in the Online Editor's toolbar. icon: '/bundles/ezplatformrichtext/assets/images/custom_tags/admin/icons/video.svg#video' attributes: @@ -38,14 +38,14 @@ Feature: Example scenarios showing how to set custom tags configuration """ ezyoutube_test """ - And I create a file "templates/field_type/ezrichtext/custom_tag/ezyoutube.html.twig" with content from "Files/Richtext/CustomTag/twig/ezyoutube.html.twig" + And I create a file "templates/field_type/ibexa_fieldtype_richtext/custom_tag/ezyoutube.html.twig" with content from "Files/Richtext/CustomTag/twig/ezyoutube.html.twig" And I create a file "translations/custom_tags.en.yaml" with content from "Files/Richtext/CustomTag/translations/ezyoutube.en.yaml" Scenario: Add Twitter custom tag configuration - Given I "append" configuration to "ezrichtext.custom_tags" + Given I "append" configuration to "ibexa_fieldtype_richtext.custom_tags" """ eztwitter_test: - template: field_type/ezrichtext/custom_tag/eztwitter.html.twig + template: field_type/ibexa_fieldtype_richtext/custom_tag/eztwitter.html.twig icon: '/bundles/ezplatformrichtext/assets/images/custom_tags/admin/icons/twitter.svg#twitter' attributes: tweet_url: @@ -83,14 +83,14 @@ Feature: Example scenarios showing how to set custom tags configuration """ eztwitter_test """ - And I create a file "templates/field_type/ezrichtext/custom_tag/eztwitter.html.twig" with content from "Files/Richtext/CustomTag/twig/eztwitter.html.twig" + And I create a file "templates/field_type/ibexa_fieldtype_richtext/custom_tag/eztwitter.html.twig" with content from "Files/Richtext/CustomTag/twig/eztwitter.html.twig" And I append to "translations/custom_tags.en.yaml" file "Files/Richtext/CustomTag/translations/eztwitter.en.yaml" Scenario: Add Facebook custom tag configuration - Given I "append" configuration to "ezrichtext.custom_tags" + Given I "append" configuration to "ibexa_fieldtype_richtext.custom_tags" """ ezfacebook_test: - template: field_type/ezrichtext/custom_tag/ezfacebook.html.twig + template: field_type/ibexa_fieldtype_richtext/custom_tag/ezfacebook.html.twig icon: '/bundles/ezplatformrichtext/assets/images/custom_tags/admin/icons/facebook.svg#facebook' attributes: post_url: @@ -103,5 +103,5 @@ Feature: Example scenarios showing how to set custom tags configuration """ ezfacebook_test """ - And I create a file "templates/field_type/ezrichtext/custom_tag/ezfacebook.html.twig" with content from "Files/Richtext/CustomTag/twig/ezfacebook.html.twig" - And I append to "translations/custom_tags.en.yaml" file "Files/Richtext/CustomTag/translations/ezfacebook.en.yaml" \ No newline at end of file + And I create a file "templates/field_type/ibexa_fieldtype_richtext/custom_tag/ezfacebook.html.twig" with content from "Files/Richtext/CustomTag/twig/ezfacebook.html.twig" + And I append to "translations/custom_tags.en.yaml" file "Files/Richtext/CustomTag/translations/ezfacebook.en.yaml" diff --git a/phpunit.xml b/phpunit.xml index d7033134..8a186cee 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ - + tests/ diff --git a/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php b/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php index b1d2d64d..b02abaab 100644 --- a/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php +++ b/src/bundle/Cache/JsRoutingDirectoryCacheDirectoryCreator.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Cache; +namespace Ibexa\Bundle\Behat\Cache; use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; diff --git a/src/bundle/Command/CreateExampleDataCommand.php b/src/bundle/Command/CreateExampleDataCommand.php index 200d9f34..32f61eee 100644 --- a/src/bundle/Command/CreateExampleDataCommand.php +++ b/src/bundle/Command/CreateExampleDataCommand.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Command; +namespace Ibexa\Bundle\Behat\Command; -use eZ\Bundle\EzPublishCoreBundle\Command\BackwardCompatibleCommand; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\InitialEvent; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\InitialEvent; +use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; use Symfony\Component\Console\Command\Command; @@ -95,3 +95,5 @@ public function getDeprecatedAliases(): array return ['ezplatform:tools:create-data']; } } + +class_alias(CreateExampleDataCommand::class, 'EzSystems\BehatBundle\Command\CreateExampleDataCommand'); diff --git a/src/bundle/Command/CreateExampleDataManagerCommand.php b/src/bundle/Command/CreateExampleDataManagerCommand.php index 530d72e4..403f403e 100644 --- a/src/bundle/Command/CreateExampleDataManagerCommand.php +++ b/src/bundle/Command/CreateExampleDataManagerCommand.php @@ -6,12 +6,13 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Command; +namespace Ibexa\Bundle\Behat\Command; -use eZ\Bundle\EzPublishCoreBundle\Command\BackwardCompatibleCommand; -use EzSystems\Behat\Event\InitialEvent; +use Ibexa\Behat\Event\InitialEvent; +use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; @@ -117,7 +118,7 @@ private function executeCommand(OutputInterface $output, $cmd, float $timeout = private function getData() { - $data = Yaml::parseFile(sprintf('%s/vendor/ezsystems/behatbundle/features/setup/volume/data.yaml', $this->projectDir)); + $data = Yaml::parseFile(sprintf('%s/vendor/ibexa/behat/features/setup/volume/data.yaml', $this->projectDir)); return $data['countries']; } @@ -133,6 +134,11 @@ private function createProcesses(OutputInterface $output, $data) while (count($this->processes)) { foreach ($this->processes as $i => $runningProcess) { if (!$runningProcess->isRunning()) { + if (!$runningProcess->isSuccessful()) { + $stderr = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; + $stderr->writeln($runningProcess->getErrorOutput()); + } + unset($this->processes[$i]); } sleep(1); @@ -161,3 +167,5 @@ public function getDeprecatedAliases(): array return ['ezplatform:tools:generate-items']; } } + +class_alias(CreateExampleDataManagerCommand::class, 'EzSystems\BehatBundle\Command\CreateExampleDataManagerCommand'); diff --git a/src/bundle/Command/CreateLanguageCommand.php b/src/bundle/Command/CreateLanguageCommand.php index f9639365..0b046e54 100644 --- a/src/bundle/Command/CreateLanguageCommand.php +++ b/src/bundle/Command/CreateLanguageCommand.php @@ -6,12 +6,12 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Command; +namespace Ibexa\Bundle\Behat\Command; -use eZ\Bundle\EzPublishCoreBundle\Command\BackwardCompatibleCommand; -use eZ\Publish\API\Repository\LanguageService; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; +use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; +use Ibexa\Contracts\Core\Repository\LanguageService; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -19,13 +19,13 @@ class CreateLanguageCommand extends Command implements BackwardCompatibleCommand { - /** @var \eZ\Publish\API\Repository\LanguageService */ + /** @var \Ibexa\Contracts\Core\Repository\LanguageService */ private $languageService; - /** @var \eZ\Publish\API\Repository\UserService */ + /** @var \Ibexa\Contracts\Core\Repository\UserService */ private $userService; - /** @var \eZ\Publish\API\Repository\PermissionResolver */ + /** @var \Ibexa\Contracts\Core\Repository\PermissionResolver */ private $permissionResolver; public function __construct( @@ -83,3 +83,5 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } } + +class_alias(CreateLanguageCommand::class, 'EzSystems\BehatBundle\Command\CreateLanguageCommand'); diff --git a/src/bundle/Command/GetPullRequestDataCommand.php b/src/bundle/Command/GetPullRequestDataCommand.php deleted file mode 100644 index dfd7e22c..00000000 --- a/src/bundle/Command/GetPullRequestDataCommand.php +++ /dev/null @@ -1,196 +0,0 @@ -httpClient = new HttpMethodsClient( - HttpClientDiscovery::find(), - MessageFactoryDiscovery::find() - ); - } - - protected function configure() - { - $this - ->setName('ibexa:behat:get-pull-request-data') - ->setAliases(['ezplatform:tools:get-pull-request-data']) - ->setDescription('Get data about a GitHub Pull Request') - ->addArgument( - 'pull-request-url', - InputArgument::REQUIRED, - 'GitHub Pull Request URL') - ->addArgument( - 'token', - InputArgument::OPTIONAL, - 'GitHub OAuth token') - ->setHelp("This command outputs data in given order: - - repository URL - - name of the branch used in PR - - branch alias for the PR - - repository name - - corresponding metarepository branch to run tests on - - corresponding Page Builder branch to run tests on -Command accepts two parameters: GitHub Pull request link and GitHub OATH Token. -If you have configured Composer with your token it can be obtained by running 'composer config github-oauth.github.com --global'") - ->addUsage('https://github.com/ezsystems/ezplatform-admin-ui/pull/1250 ff34885a8624460a855540c6592698d2f1812843'); - } - - public function execute(InputInterface $input, OutputInterface $output) - { - $pullRequestUrl = $input->getArgument('pull-request-url'); - $this->token = $input->getArgument('token'); - - $prUrlData = $this->getPullRequestDataFromURL($pullRequestUrl); - - $responseBody = $this->getPullRequestData($prUrlData['owner'], $prUrlData['repository'], $prUrlData['prNumber'])->getBody(); - - $responseData = json_decode($responseBody->getContents(), true); - $targetBranch = $responseData['base']['ref']; - $branchName = $responseData['head']['ref']; - $repositoryURL = $responseData['head']['repo']['html_url']; - - $composerExtraData = $this->getComposerExtraData($prUrlData['owner'], $prUrlData['repository'], $targetBranch); - $metarepositoryBranch = $composerExtraData['metarepositoryTargetBranch']; - $branchAlias = $composerExtraData['branchAlias']; - $pageBuilderBranch = $this->getPageBuilderBranchName($metarepositoryBranch); - - $outputString = sprintf('%s %s %s %s %s %s', - $repositoryURL, - $branchName, - $branchAlias, - $prUrlData['repository'], - $metarepositoryBranch ?: self::UNDEFINED_VALUE, - $pageBuilderBranch ?: self::UNDEFINED_VALUE - ); - - $output->write($outputString); - - return 0; - } - - private function getPullRequestData(string $owner, string $repository, string $prNumber): ResponseInterface - { - $requestUrl = sprintf('https://api.github.com/repos/%s/%s/pulls/%s', $owner, $repository, $prNumber); - - return $this->sendRequest($requestUrl, 'application/vnd.github.v3+json'); - } - - private function getComposerExtraData(string $owner, string $repository, string $branchName): array - { - $requestUrl = sprintf( - 'https://api.github.com/repos/%s/%s/contents/composer.json?ref=%s', - $owner, - $repository, - $branchName - ); - - $composerJsonFile = $this->sendRequest($requestUrl, 'application/vnd.github.v3.raw'); - $data = json_decode($composerJsonFile->getBody()->getContents(), true); - - $branchAlias = $data['extra']['branch-alias']['dev-master']; - $metarepositoryTargetBranch = array_key_exists('_ezplatform_branch_for_behat_tests', $data['extra']) - ? $data['extra']['_ezplatform_branch_for_behat_tests'] - : ''; - - return [ - 'branchAlias' => $branchAlias, - 'metarepositoryTargetBranch' => $metarepositoryTargetBranch, - ]; - } - - private function getPullRequestDataFromURL(string $pullRequestLink): array - { - $matches = []; - preg_match('/.*github.com\/(.*)\/(.*)\/pull\/(.*)/', $pullRequestLink, $matches); - list(, $owner, $repository, $prNumber) = $matches; - - return [ - 'owner' => $owner, - 'repository' => $repository, - 'prNumber' => $prNumber, - ]; - } - - private function getPageBuilderBranchName(string $metarepositoryTargetBranch): string - { - $pageBuilderTargetBranches = [ - '2.5' => '1.3', - '3.0' => '2.0', - '3.1' => '2.1', - '3.2' => '2.2', - 'master' => 'master', - ]; - - if ($metarepositoryTargetBranch === '') { - return ''; - } - - if (!array_key_exists($metarepositoryTargetBranch, $pageBuilderTargetBranches)) { - throw new \Exception(sprintf('Cannot find suitable PageBuilder branch for %s metarepository branch', $metarepositoryTargetBranch)); - } - - return $pageBuilderTargetBranches[$metarepositoryTargetBranch]; - } - - private function sendRequest(string $requestUrl, string $acceptFormat): ResponseInterface - { - $headers = [ - 'User-Agent' => 'ezrobot', - 'Accept' => $acceptFormat, - ]; - - if ($this->token) { - $headers['Authorization'] = sprintf('token %s', $this->token); - } - - $request = new Request('GET', $requestUrl, $headers); - $response = $this->httpClient->sendRequest($request); - - if ($response->getStatusCode() !== 200) { - throw new \Exception( - sprintf('GitHub API returned code %d, expected 200. Reason: %s', - $response->getStatusCode(), - $response->getReasonPhrase()) - ); - } - - return $response; - } - - /** - * @return string[] - */ - public function getDeprecatedAliases(): array - { - return ['ezplatform:tools:get-pull-request-data']; - } -} diff --git a/src/bundle/Command/TestSiteaccessCommand.php b/src/bundle/Command/TestSiteaccessCommand.php index 79b35c52..3530df02 100644 --- a/src/bundle/Command/TestSiteaccessCommand.php +++ b/src/bundle/Command/TestSiteaccessCommand.php @@ -6,17 +6,17 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Command; +namespace Ibexa\Bundle\Behat\Command; -use eZ\Bundle\EzPublishCoreBundle\Command\BackwardCompatibleCommand; -use eZ\Publish\Core\MVC\Symfony\SiteAccess; +use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; +use Ibexa\Core\MVC\Symfony\SiteAccess; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class TestSiteaccessCommand extends Command implements BackwardCompatibleCommand { - /** @var \eZ\Publish\Core\MVC\Symfony\SiteAccess */ + /** @var \Ibexa\Core\MVC\Symfony\SiteAccess */ private $siteaccess; public function __construct(SiteAccess $siteaccess) @@ -50,3 +50,5 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } } + +class_alias(TestSiteaccessCommand::class, 'EzSystems\BehatBundle\Command\TestSiteaccessCommand'); diff --git a/src/bundle/Controller/CurrentUserDataController.php b/src/bundle/Controller/CurrentUserDataController.php index 5e5fa58a..72878716 100644 --- a/src/bundle/Controller/CurrentUserDataController.php +++ b/src/bundle/Controller/CurrentUserDataController.php @@ -8,8 +8,8 @@ namespace Ibexa\Bundle\Behat\Controller; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -17,11 +17,12 @@ class CurrentUserDataController extends AbstractController { /** - * @var \eZ\Publish\API\Repository\PermissionResolver + * @var \Ibexa\Contracts\Core\Repository\PermissionResolver */ private $permissionResolver; + /** - * @var \eZ\Publish\API\Repository\UserService + * @var \Ibexa\Contracts\Core\Repository\UserService */ private $userService; @@ -39,7 +40,7 @@ public function showCurrentUserAction(Request $request): Response $userName = $this->userService->loadUser($currentUserId)->getName(); return $this->render( - '@eZBehat/tests/login_data.html.twig', + '@IbexaBehat/tests/login_data.html.twig', [ 'username' => $userName, 'siteaccess' => $siteaccess->name, diff --git a/src/bundle/Controller/ExceptionController.php b/src/bundle/Controller/ExceptionController.php index 8116db30..7f05f516 100644 --- a/src/bundle/Controller/ExceptionController.php +++ b/src/bundle/Controller/ExceptionController.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Controller; +namespace Ibexa\Bundle\Behat\Controller; -use eZ\Publish\Core\Base\Exceptions\UnauthorizedException; +use Ibexa\Core\Base\Exceptions\UnauthorizedException; class ExceptionController { @@ -17,3 +17,5 @@ public function throwRepositoryUnauthorizedAction($module = 'foo', $function = ' throw new UnauthorizedException($module, $function, $properties); } } + +class_alias(ExceptionController::class, 'EzSystems\BehatBundle\Controller\ExceptionController'); diff --git a/src/bundle/Controller/RenderController.php b/src/bundle/Controller/RenderController.php index 9dbd31a2..63cab0f2 100644 --- a/src/bundle/Controller/RenderController.php +++ b/src/bundle/Controller/RenderController.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Controller; +namespace Ibexa\Bundle\Behat\Controller; -use eZ\Bundle\EzPublishCoreBundle\Controller; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\Core\MVC\Symfony\View\ContentView; +use Ibexa\Bundle\Core\Controller; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Core\MVC\Symfony\View\ContentView; class RenderController extends Controller { @@ -37,3 +37,5 @@ public function longAction(ContentView $view): ContentView return $view; } } + +class_alias(RenderController::class, 'EzSystems\BehatBundle\Controller\RenderController'); diff --git a/src/bundle/Controller/UnauthenticatedRedirectController.php b/src/bundle/Controller/UnauthenticatedRedirectController.php index 8c3e6b19..c851271b 100644 --- a/src/bundle/Controller/UnauthenticatedRedirectController.php +++ b/src/bundle/Controller/UnauthenticatedRedirectController.php @@ -19,6 +19,6 @@ public function performAccessCheck() public function redirectAction() { - return $this->redirectToRoute('ibexa_testing_current_user_data'); + return $this->redirectToRoute('ibexa.behat.current_user_data'); } } diff --git a/src/bundle/DependencyInjection/Compiler/ElementFactoryCompilerPass.php b/src/bundle/DependencyInjection/Compiler/ElementFactoryCompilerPass.php index d0588118..6498f47e 100644 --- a/src/bundle/DependencyInjection/Compiler/ElementFactoryCompilerPass.php +++ b/src/bundle/DependencyInjection/Compiler/ElementFactoryCompilerPass.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\DependencyInjection\Compiler; +namespace Ibexa\Bundle\Behat\DependencyInjection\Compiler; -use EzSystems\BehatBundle\DependencyInjection\eZBehatExtension; use Ibexa\Behat\Browser\Element\Factory\Debug\Interactive\ElementFactory; +use Ibexa\Bundle\Behat\DependencyInjection\IbexaBehatExtension; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -23,7 +23,7 @@ public function process(ContainerBuilder $container) $interactiveDebugElementFactory = $container->findDefinition(ElementFactory::class); - $componentServiceIds = array_keys($container->findTaggedServiceIds('ibexa.testing.browser.component')); + $componentServiceIds = array_keys($container->findTaggedServiceIds('ibexa.behat.browser.component')); foreach ($componentServiceIds as $componentServiceId) { $compontentDefinition = $container->findDefinition($componentServiceId); $compontentDefinition->addMethodCall('setElementFactory', [$interactiveDebugElementFactory]); @@ -32,7 +32,9 @@ public function process(ContainerBuilder $container) private function shouldEnableInteractiveDebug(ContainerBuilder $container): bool { - return $container->hasParameter(eZBehatExtension::BROWSER_DEBUG_INTERACTIVE_ENABLED) && - $container->getParameter(eZBehatExtension::BROWSER_DEBUG_INTERACTIVE_ENABLED); + return $container->hasParameter(IbexaBehatExtension::BROWSER_DEBUG_INTERACTIVE_ENABLED) && + $container->getParameter(IbexaBehatExtension::BROWSER_DEBUG_INTERACTIVE_ENABLED); } } + +class_alias(ElementFactoryCompilerPass::class, 'EzSystems\BehatBundle\DependencyInjection\Compiler\ElementFactoryCompilerPass'); diff --git a/src/bundle/DependencyInjection/Compiler/FieldTypeDataProviderPass.php b/src/bundle/DependencyInjection/Compiler/FieldTypeDataProviderPass.php index 854a30e1..9034ef75 100644 --- a/src/bundle/DependencyInjection/Compiler/FieldTypeDataProviderPass.php +++ b/src/bundle/DependencyInjection/Compiler/FieldTypeDataProviderPass.php @@ -6,10 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\DependencyInjection\Compiler; +namespace Ibexa\Bundle\Behat\DependencyInjection\Compiler; -use EzSystems\Behat\API\ContentData\ContentDataProvider; -use EzSystems\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface; +use Ibexa\Behat\API\ContentData\ContentDataProvider; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; @@ -19,7 +18,7 @@ class FieldTypeDataProviderPass implements CompilerPassInterface public function process(ContainerBuilder $container) { $contentDataDefinition = $container->findDefinition(ContentDataProvider::class); - $strategyServiceIds = array_keys($container->findTaggedServiceIds(FieldTypeDataProviderInterface::SERVICE_TAG)); + $strategyServiceIds = array_keys($container->findTaggedServiceIds('ibexa.behat.fieldtype_data_provider')); foreach ($strategyServiceIds as $strategyServiceId) { $contentDataDefinition->addMethodCall( @@ -29,3 +28,5 @@ public function process(ContainerBuilder $container) } } } + +class_alias(FieldTypeDataProviderPass::class, 'EzSystems\BehatBundle\DependencyInjection\Compiler\FieldTypeDataProviderPass'); diff --git a/src/bundle/DependencyInjection/Compiler/LimitationParserPass.php b/src/bundle/DependencyInjection/Compiler/LimitationParserPass.php index c229ab51..96d978a6 100644 --- a/src/bundle/DependencyInjection/Compiler/LimitationParserPass.php +++ b/src/bundle/DependencyInjection/Compiler/LimitationParserPass.php @@ -6,10 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\DependencyInjection\Compiler; +namespace Ibexa\Bundle\Behat\DependencyInjection\Compiler; -use EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface; -use EzSystems\Behat\API\Context\LimitationParser\LimitationParsersCollector; +use Ibexa\Behat\API\Context\LimitationParser\LimitationParsersCollector; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; @@ -19,7 +18,7 @@ class LimitationParserPass implements CompilerPassInterface public function process(ContainerBuilder $container) { $parserCollector = $container->findDefinition(LimitationParsersCollector::class); - $strategyServiceIds = array_keys($container->findTaggedServiceIds(LimitationParserInterface::SERVICE_TAG)); + $strategyServiceIds = array_keys($container->findTaggedServiceIds('ibexa.behat.limitation_parser')); foreach ($strategyServiceIds as $strategyServiceId) { $parserCollector->addMethodCall( @@ -29,3 +28,5 @@ public function process(ContainerBuilder $container) } } } + +class_alias(LimitationParserPass::class, 'EzSystems\BehatBundle\DependencyInjection\Compiler\LimitationParserPass'); diff --git a/src/bundle/DependencyInjection/eZBehatExtension.php b/src/bundle/DependencyInjection/IbexaBehatExtension.php similarity index 61% rename from src/bundle/DependencyInjection/eZBehatExtension.php rename to src/bundle/DependencyInjection/IbexaBehatExtension.php index b4fc7404..169458cc 100644 --- a/src/bundle/DependencyInjection/eZBehatExtension.php +++ b/src/bundle/DependencyInjection/IbexaBehatExtension.php @@ -6,8 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\DependencyInjection; +namespace Ibexa\Bundle\Behat\DependencyInjection; +use Ibexa\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface; +use Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface; use Ibexa\Behat\Browser\Component\Component; use Ibexa\Behat\Browser\Page\PageInterface; use Ibexa\Behat\Browser\Page\Preview\PagePreviewInterface; @@ -19,13 +21,13 @@ use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\HttpKernel\DependencyInjection\Extension; -class eZBehatExtension extends Extension implements PrependExtensionInterface, CompilerPassInterface +class IbexaBehatExtension extends Extension implements PrependExtensionInterface, CompilerPassInterface { - private const OVERRIDE_CONFIGURATION = 'ibexa.testing.override_configuration'; + private const OVERRIDE_CONFIGURATION = 'ibexa.behat.override_configuration'; - private const BROWSER_TESTING_ENABLED = 'ibexa.testing.browser.enabled'; + private const BROWSER_TESTING_ENABLED = 'ibexa.behat.browser.enabled'; - public const BROWSER_DEBUG_INTERACTIVE_ENABLED = 'ibexa.testing.behat.browser.debug.interactive.enabled'; + public const BROWSER_DEBUG_INTERACTIVE_ENABLED = 'ibexa.behat.browser.debug.interactive.enabled'; public function process(ContainerBuilder $container) { @@ -33,7 +35,7 @@ public function process(ContainerBuilder $container) return; } - $container->setParameter('ezsettings.admin_group.notifications.success.timeout', 20000); + $container->setParameter('ibexa.site_access.config.admin_group.notifications.success.timeout', 20000); } public function prepend(ContainerBuilder $container) @@ -56,22 +58,30 @@ public function load(array $config, ContainerBuilder $container) } $container->registerForAutoconfiguration(Component::class) - ->addTag('ibexa.testing.browser.component'); + ->addTag('ibexa.behat.browser.component'); $container->registerForAutoconfiguration(PageInterface::class) - ->addTag('ibexa.testing.browser.page'); + ->addTag('ibexa.behat.browser.page'); $container->registerForAutoconfiguration(PagePreviewInterface::class) - ->addTag('ibexa.testing.browser.page_preview'); + ->addTag('ibexa.behat.browser.page_preview'); $container->registerForAutoconfiguration(KnownIssueInterface::class) ->addTag('ibexa.testing.browser.known_issue'); + + $container->registerForAutoconfiguration(FieldTypeDataProviderInterface::class) + ->addTag('ibexa.behat.fieldtype_data_provider'); + + $container->registerForAutoconfiguration(LimitationParserInterface::class) + ->addTag('ibexa.behat.limitation_parser'); } private function shouldLoadDxpServices(ContainerBuilder $container) { $bundles = $container->getParameter('kernel.bundles'); - return isset($bundles['EzPlatformPageBuilderBundle'], $bundles['EzPlatformWorkflowBundle']); + return isset($bundles['IbexaPageBuilderBundle'], $bundles['IbexaWorkflowBundle']); } } + +class_alias(IbexaBehatExtension::class, 'EzSystems\BehatBundle\DependencyInjection\eZBehatExtension'); diff --git a/src/bundle/EzSystemsBehatBundle.php b/src/bundle/IbexaBehatBundle.php similarity index 60% rename from src/bundle/EzSystemsBehatBundle.php rename to src/bundle/IbexaBehatBundle.php index 1826839f..75e58315 100644 --- a/src/bundle/EzSystemsBehatBundle.php +++ b/src/bundle/IbexaBehatBundle.php @@ -6,18 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle; +namespace Ibexa\Bundle\Behat; -use EzSystems\BehatBundle\DependencyInjection\Compiler\ElementFactoryCompilerPass; -use EzSystems\BehatBundle\DependencyInjection\Compiler\FieldTypeDataProviderPass; -use EzSystems\BehatBundle\DependencyInjection\Compiler\LimitationParserPass; +use Ibexa\Bundle\Behat\DependencyInjection\Compiler\ElementFactoryCompilerPass; +use Ibexa\Bundle\Behat\DependencyInjection\Compiler\FieldTypeDataProviderPass; +use Ibexa\Bundle\Behat\DependencyInjection\Compiler\LimitationParserPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; -class EzSystemsBehatBundle extends Bundle +class IbexaBehatBundle extends Bundle { - protected $name = 'eZBehatBundle'; - public function build(ContainerBuilder $container) { $container->addCompilerPass(new FieldTypeDataProviderPass()); @@ -25,3 +23,5 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new ElementFactoryCompilerPass()); } } + +class_alias(IbexaBehatBundle::class, 'EzSystems\BehatBundle\EzSystemsBehatBundle'); diff --git a/src/bundle/BehatExtension.php b/src/bundle/IbexaExtension.php similarity index 71% rename from src/bundle/BehatExtension.php rename to src/bundle/IbexaExtension.php index 31b2935c..7947d498 100644 --- a/src/bundle/BehatExtension.php +++ b/src/bundle/IbexaExtension.php @@ -6,15 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle; +namespace Ibexa\Bundle\Behat; use Behat\Behat\EventDispatcher\ServiceContainer\EventDispatcherExtension; use Behat\Testwork\Exception\ServiceContainer\ExceptionExtension; use Behat\Testwork\ServiceContainer\Extension; use Behat\Testwork\ServiceContainer\ExtensionManager; -use EzSystems\BehatBundle\Initializer\BehatSiteAccessInitializer; use FriendsOfBehat\SymfonyExtension\ServiceContainer\SymfonyExtension; use Ibexa\Bundle\Behat\Extension\ExceptionStringer\PHPUnit10ExceptionStringer; +use Ibexa\Bundle\Behat\Initializer\BehatSiteAccessInitializer; +use Ibexa\Bundle\Behat\Subscriber\StartScenarioSubscriber; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -22,13 +23,17 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Reference; -class BehatExtension implements Extension +class IbexaExtension implements Extension { private const MINK_DEFAULT_JAVASCRIPT_SESSION_PARAMETER = 'ibexa.platform.behat.mink.default_javascript_session'; + private const WIDTH_PARAMETER = 'ibexa.behat.browser.width'; + + private const HEIGHT_PARAMETER = 'ibexa.behat.browser.height'; + public function getConfigKey() { - return 'ezbehatextension'; + return 'ibexabehatextension'; } public function process(ContainerBuilder $container) @@ -50,6 +55,8 @@ public function configure(ArrayNodeDefinition $builder) ->arrayNode('mink') ->children() ->scalarNode('default_javascript_session')->defaultNull()->end() + ->scalarNode('width')->defaultValue(1440)->end() + ->scalarNode('height')->defaultValue(1080)->end() ->end() ->end() ->end(); @@ -59,6 +66,7 @@ public function load(ContainerBuilder $container, array $config) { $this->loadExceptionStringer($container); $this->loadSiteAccessInitializer($container); + $this->loadStartScenarioSubscriber($container); $this->setMinkParameters($container, $config); $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/Resources/config')); @@ -98,10 +106,32 @@ private function setMinkParameters(ContainerBuilder $container, array $config): $container->setParameter($parameter, $value); } } + + $container->setParameter(self::WIDTH_PARAMETER, (int) $config['mink']['width']); + $container->setParameter(self::HEIGHT_PARAMETER, (int) $config['mink']['height']); } private function setDefaultJavascriptSession(ContainerBuilder $container, string $defaultJavascriptSession): void { $container->setParameter('mink.javascript_session', $defaultJavascriptSession); } + + private function loadStartScenarioSubscriber(ContainerBuilder $container) + { + $definition = new Definition(StartScenarioSubscriber::class); + $definition->setArguments([ + new Reference(SymfonyExtension::KERNEL_ID), + $this->getParameterReference(self::WIDTH_PARAMETER), + $this->getParameterReference(self::HEIGHT_PARAMETER), + ]); + $definition->addTag(EventDispatcherExtension::SUBSCRIBER_TAG, ['priority' => StartScenarioSubscriber::PRIORITY]); + $container->setDefinition(StartScenarioSubscriber::class, $definition); + } + + private function getParameterReference(string $name): string + { + return '%' . $name . '%'; + } } + +class_alias(IbexaExtension::class, 'EzSystems\BehatBundle\BehatExtension'); diff --git a/src/bundle/Initializer/BehatSiteAccessInitializer.php b/src/bundle/Initializer/BehatSiteAccessInitializer.php index ebaddfa5..4d9e2871 100644 --- a/src/bundle/Initializer/BehatSiteAccessInitializer.php +++ b/src/bundle/Initializer/BehatSiteAccessInitializer.php @@ -6,20 +6,20 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Initializer; +namespace Ibexa\Bundle\Behat\Initializer; use Behat\Behat\EventDispatcher\Event\ExampleTested; use Behat\Behat\EventDispatcher\Event\ScenarioTested; -use eZ\Publish\Core\MVC\Symfony\Event\ScopeChangeEvent; -use eZ\Publish\Core\MVC\Symfony\MVCEvents; -use eZ\Publish\Core\MVC\Symfony\SiteAccess; +use Ibexa\Core\MVC\Symfony\Event\ScopeChangeEvent; +use Ibexa\Core\MVC\Symfony\MVCEvents; +use Ibexa\Core\MVC\Symfony\SiteAccess; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelInterface; final class BehatSiteAccessInitializer implements EventSubscriberInterface { - private const EZPLATFORM_SITEACCESS_ENV_VAR = 'EZPLATFORM_SITEACCESS'; - private const DEFAULT_SITEACCESS_PARAMETER = 'ezpublish.siteaccess.default'; + private const SITEACCESS_ENV_VAR = 'IBEXA_SITEACCESS'; + private const DEFAULT_SITEACCESS_PARAMETER = 'ibexa.site_access.default'; private const EVENT_DISPATCHER_SERVICE_ID = 'event_dispatcher'; /** @var \Symfony\Component\HttpKernel\KernelInterface */ @@ -51,7 +51,7 @@ public function setSiteAccess(): void private function getSiteAccess(): SiteAccess { - $siteAccessFromEnvVar = getenv(self::EZPLATFORM_SITEACCESS_ENV_VAR); + $siteAccessFromEnvVar = getenv(self::SITEACCESS_ENV_VAR); $defaultSiteAccess = $this->kernel->getContainer()->getParameter(self::DEFAULT_SITEACCESS_PARAMETER); $siteAccessName = $siteAccessFromEnvVar !== false ? $siteAccessFromEnvVar : $defaultSiteAccess; @@ -59,3 +59,5 @@ private function getSiteAccess(): SiteAccess return new SiteAccess($siteAccessName, 'cli'); } } + +class_alias(BehatSiteAccessInitializer::class, 'EzSystems\BehatBundle\Initializer\BehatSiteAccessInitializer'); diff --git a/src/bundle/Resources/config/routing.yaml b/src/bundle/Resources/config/routing.yaml index dcd7e6b6..1d07c7df 100644 --- a/src/bundle/Resources/config/routing.yaml +++ b/src/bundle/Resources/config/routing.yaml @@ -1,9 +1,9 @@ -ez_platform_behat_repository_unauthorized_exception: +ibexa.behat.repository_unauthorized_exception: path: '/platform-behat/exceptions/repository-unauthorized' defaults: - _controller: 'ezbehatbundle.controller.exception:throwRepositoryUnauthorizedAction' + _controller: 'Ibexa\Bundle\Behat\Controller\ExceptionController::throwRepositoryUnauthorizedAction' -ibexa_testing_current_user_data: +ibexa.behat.current_user_data: path: '/current_user_data' defaults: _controller: 'Ibexa\Bundle\Behat\Controller\CurrentUserDataController::showCurrentUserAction' diff --git a/src/bundle/Resources/config/services.yaml b/src/bundle/Resources/config/services.yaml index 258e73a8..75b8db1d 100644 --- a/src/bundle/Resources/config/services.yaml +++ b/src/bundle/Resources/config/services.yaml @@ -13,85 +13,81 @@ services: autoconfigure: true public: false - EzSystems\BehatBundle\Cache\JsRoutingDirectoryCacheDirectoryCreator: ~ + Ibexa\Bundle\Behat\Cache\JsRoutingDirectoryCacheDirectoryCreator: ~ - EzSystems\Behat\API\ContentData\ContentDataProvider: + Ibexa\Behat\API\ContentData\ContentDataProvider: arguments: - - '@ezpublish.api.service.content_type' - - '@ezpublish.api.service.content' + - '@ibexa.api.service.content_type' + - '@ibexa.api.service.content' - EzSystems\Behat\API\ContentData\RandomDataGenerator: ~ + Ibexa\Behat\API\ContentData\RandomDataGenerator: ~ - EzSystems\Behat\API\Facade\ContentFacade: + Ibexa\Behat\API\Facade\ContentFacade: public: true - EzSystems\Behat\API\Facade\SearchFacade: + Ibexa\Behat\API\Facade\SearchFacade: arguments: - - '@eZ\Publish\API\Repository\URLAliasService' - - '@eZ\Publish\API\Repository\LocationService' - - '@ezpublish.api.service.search' + - '@Ibexa\Contracts\Core\Repository\URLAliasService' + - '@Ibexa\Contracts\Core\Repository\LocationService' + - '@ibexa.api.service.search' - EzSystems\Behat\API\Facade\ContentTypeFacade: + Ibexa\Behat\API\Facade\ContentTypeFacade: public: true arguments: - - '@ezpublish.api.service.content_type' - - '@ezpublish.cache_pool' + - '@ibexa.api.service.content_type' + - '@ibexa.cache_pool' - EzSystems\Behat\API\Facade\RoleFacade: + Ibexa\Behat\API\Facade\RoleFacade: public: true - EzSystems\Behat\API\Facade\UserFacade: + Ibexa\Behat\API\Facade\UserFacade: public: true - EzSystems\Behat\API\Facade\LanguageFacade: + Ibexa\Behat\API\Facade\LanguageFacade: public: true - EzSystems\Behat\API\Facade\TrashFacade: + Ibexa\Behat\API\Facade\TrashFacade: public: true Ibexa\Behat\Browser\Environment\ParameterProvider: ~ Ibexa\Behat\Browser\Environment\ParameterProviderInterface: '@Ibexa\Behat\Browser\Environment\ParameterProvider' - EzSystems\Behat\Core\Behat\ArgumentParser: + Ibexa\Behat\Core\Behat\ArgumentParser: public: true arguments: - - '@EzSystems\Behat\API\Facade\RoleFacade' + - '@Ibexa\Behat\API\Facade\RoleFacade' - EzSystems\BehatBundle\Command\CreateLanguageCommand: + Ibexa\Bundle\Behat\Command\CreateLanguageCommand: arguments: - $languageService: '@ezpublish.api.service.language' - $userService: '@ezpublish.api.service.user' - $permissionResolver: '@eZ\Publish\API\Repository\PermissionResolver' + $languageService: '@ibexa.api.service.language' + $userService: '@ibexa.api.service.user' + $permissionResolver: '@Ibexa\Contracts\Core\Repository\PermissionResolver' tags: - { name: console.command } - EzSystems\BehatBundle\Command\GetPullRequestDataCommand: - tags: - - { name: console.command } - - EzSystems\BehatBundle\Templating\Twig\PHPTypeExtension: + Ibexa\Bundle\Behat\Templating\Twig\PHPTypeExtension: tags: - { name: twig.extension } - EzSystems\BehatBundle\Command\TestSiteaccessCommand: + Ibexa\Bundle\Behat\Command\TestSiteaccessCommand: arguments: - $siteaccess: '@ezpublish.siteaccess' + $siteaccess: '@Ibexa\Core\MVC\Symfony\SiteAccess' tags: - { name: console.command } - EzSystems\Behat\QueryType\FoldersUnderMediaQueryType: ~ + Ibexa\Behat\QueryType\FoldersUnderMediaQueryType: ~ - EzSystems\Behat\Core\Configuration\ConfigurationEditor: ~ + Ibexa\Behat\Core\Configuration\ConfigurationEditor: ~ - EzSystems\Behat\Core\Configuration\LocationAwareConfigurationEditor: - decorates: EzSystems\Behat\Core\Configuration\ConfigurationEditor + Ibexa\Behat\Core\Configuration\LocationAwareConfigurationEditor: + decorates: Ibexa\Behat\Core\Configuration\ConfigurationEditor Ibexa\Behat\Browser\Routing\Router: arguments: - $router: '@ezpublish.siteaccess_router' + $router: '@Ibexa\Core\MVC\Symfony\SiteAccess\Router' - EzSystems\Behat\Core\Configuration\ConfigurationEditorInterface: '@EzSystems\Behat\Core\Configuration\LocationAwareConfigurationEditor' + Ibexa\Behat\Core\Configuration\ConfigurationEditorInterface: '@Ibexa\Behat\Core\Configuration\LocationAwareConfigurationEditor' Ibexa\Behat\Browser\FileUpload\FileUploadHelper: ~ diff --git a/src/bundle/Resources/config/services/contexts.yaml b/src/bundle/Resources/config/services/contexts.yaml index f194a1af..64d4b8a0 100644 --- a/src/bundle/Resources/config/services/contexts.yaml +++ b/src/bundle/Resources/config/services/contexts.yaml @@ -4,57 +4,57 @@ services: autoconfigure: true public: false - EzSystems\Behat\API\Context\ContentContext: + Ibexa\Behat\API\Context\ContentContext: public: true arguments: - $contentFacade: '@EzSystems\Behat\API\Facade\ContentFacade' - $argumentParser: '@EzSystems\Behat\Core\Behat\ArgumentParser' + $contentFacade: '@Ibexa\Behat\API\Facade\ContentFacade' + $argumentParser: '@Ibexa\Behat\Core\Behat\ArgumentParser' - EzSystems\Behat\API\Context\TrashContext: + Ibexa\Behat\API\Context\TrashContext: public: true arguments: - $trashFacade: '@EzSystems\Behat\API\Facade\TrashFacade' - $argumentParser: '@EzSystems\Behat\Core\Behat\ArgumentParser' + $trashFacade: '@Ibexa\Behat\API\Facade\TrashFacade' + $argumentParser: '@Ibexa\Behat\Core\Behat\ArgumentParser' - EzSystems\Behat\API\Context\ContentTypeContext: + Ibexa\Behat\API\Context\ContentTypeContext: public: true arguments: - $contentTypeFacade: '@EzSystems\Behat\API\Facade\ContentTypeFacade' + $contentTypeFacade: '@Ibexa\Behat\API\Facade\ContentTypeFacade' - EzSystems\Behat\API\Context\LanguageContext: + Ibexa\Behat\API\Context\LanguageContext: public: true arguments: - $languageFacade: '@EzSystems\Behat\API\Facade\LanguageFacade' + $languageFacade: '@Ibexa\Behat\API\Facade\LanguageFacade' - EzSystems\Behat\API\Context\ObjectStateContext: + Ibexa\Behat\API\Context\ObjectStateContext: public: true arguments: - $objectStateService: '@ezpublish.api.service.object_state' + $objectStateService: '@ibexa.api.service.object_state' - EzSystems\Behat\API\Context\RoleContext: + Ibexa\Behat\API\Context\RoleContext: public: true arguments: - $roleFacade: '@EzSystems\Behat\API\Facade\RoleFacade' - $argumentParser: '@EzSystems\Behat\Core\Behat\ArgumentParser' + $roleFacade: '@Ibexa\Behat\API\Facade\RoleFacade' + $argumentParser: '@Ibexa\Behat\Core\Behat\ArgumentParser' - EzSystems\Behat\API\Context\TestContext: + Ibexa\Behat\API\Context\TestContext: public: true arguments: - $userService: '@ezpublish.api.service.user' - $permissionResolver: '@eZ\Publish\API\Repository\PermissionResolver' + $userService: '@ibexa.api.service.user' + $permissionResolver: '@Ibexa\Contracts\Core\Repository\PermissionResolver' - EzSystems\Behat\API\Context\UserContext: + Ibexa\Behat\API\Context\UserContext: public: true arguments: - $userFacade: '@EzSystems\Behat\API\Facade\UserFacade' - $argumentParser: '@EzSystems\Behat\Core\Behat\ArgumentParser' + $userFacade: '@Ibexa\Behat\API\Facade\UserFacade' + $argumentParser: '@Ibexa\Behat\Core\Behat\ArgumentParser' - EzSystems\Behat\Core\Context\ConfigurationContext: + Ibexa\Behat\Core\Context\ConfigurationContext: public: true arguments: $projectDir: '%kernel.project_dir%' - EzSystems\Behat\Core\Context\FileContext: + Ibexa\Behat\Core\Context\FileContext: public: true arguments: $projectDirectory: '%kernel.project_dir%' @@ -67,7 +67,7 @@ services: $logger: '@logger' $logDir: '%kernel.logs_dir%' - EzSystems\Behat\Core\Context\TimeContext: ~ + Ibexa\Behat\Core\Context\TimeContext: ~ Ibexa\Behat\Browser\Context\ContentPreviewContext: ~ diff --git a/src/bundle/Resources/config/services/controllers.yaml b/src/bundle/Resources/config/services/controllers.yaml index fa6fdace..7fe71f61 100644 --- a/src/bundle/Resources/config/services/controllers.yaml +++ b/src/bundle/Resources/config/services/controllers.yaml @@ -4,14 +4,14 @@ services: autoconfigure: true public: false - EzSystems\BehatBundle\Controller\ExceptionController: + Ibexa\Bundle\Behat\Controller\ExceptionController: public: true ezbehatbundle.controller.exception: - class: EzSystems\BehatBundle\Controller\ExceptionController + class: Ibexa\Bundle\Behat\Controller\ExceptionController public: true - EzSystems\BehatBundle\Controller\RenderController: ~ + Ibexa\Bundle\Behat\Controller\RenderController: ~ Ibexa\Bundle\Behat\Controller\UnauthenticatedRedirectController: tags: [ 'controller.service_arguments' ] diff --git a/src/bundle/Resources/config/services/fieldtype_data_providers.yaml b/src/bundle/Resources/config/services/fieldtype_data_providers.yaml index 92669595..c2babd81 100644 --- a/src/bundle/Resources/config/services/fieldtype_data_providers.yaml +++ b/src/bundle/Resources/config/services/fieldtype_data_providers.yaml @@ -4,83 +4,79 @@ services: autoconfigure: true public: false - _instanceof: - EzSystems\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface: - tags: ['ezplatform.behat.fieldtype_data_provider'] + Ibexa\Behat\API\ContentData\FieldTypeData\RandomDataGenerator: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\RandomDataGenerator: ~ - - EzSystems\Behat\API\ContentData\FieldTypeData\ObjectRelationDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\ObjectRelationDataProvider: arguments: - - '@EzSystems\Behat\API\Facade\SearchFacade' - - '@ezpublish.api.service.content' + - '@Ibexa\Behat\API\Facade\SearchFacade' + - '@ibexa.api.service.content' - EzSystems\Behat\API\ContentData\FieldTypeData\ObjectRelationListDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\ObjectRelationListDataProvider: arguments: - - '@EzSystems\Behat\API\Facade\SearchFacade' - - '@ezpublish.api.service.content' + - '@Ibexa\Behat\API\Facade\SearchFacade' + - '@ibexa.api.service.content' - EzSystems\Behat\API\ContentData\FieldTypeData\AuthorDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\AuthorDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\BinaryFileDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\BinaryFileDataProvider: arguments: $projectDir: '%kernel.project_dir%' - EzSystems\Behat\API\ContentData\FieldTypeData\BooleanDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\BooleanDataProvider: arguments: - - '@EzSystems\Behat\API\ContentData\RandomDataGenerator' - - '@eZ\Publish\API\Repository\ContentTypeService' + - '@Ibexa\Behat\API\ContentData\RandomDataGenerator' + - '@Ibexa\Contracts\Core\Repository\ContentTypeService' - EzSystems\Behat\API\ContentData\FieldTypeData\CountryDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\CountryDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\DateDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\DateDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\DateTimeDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\DateTimeDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\EmailDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\EmailDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\FloatDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\FloatDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\ISBNDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\ISBNDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\MatrixDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\MatrixDataProvider: arguments: - - '@EzSystems\Behat\API\ContentData\RandomDataGenerator' - - '@eZ\Publish\API\Repository\ContentTypeService' + - '@Ibexa\Behat\API\ContentData\RandomDataGenerator' + - '@Ibexa\Contracts\Core\Repository\ContentTypeService' - EzSystems\Behat\API\ContentData\FieldTypeData\SelectionDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\SelectionDataProvider: arguments: - - '@eZ\Publish\API\Repository\ContentTypeService' + - '@Ibexa\Contracts\Core\Repository\ContentTypeService' - EzSystems\Behat\API\ContentData\FieldTypeData\ImageAssetDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\ImageAssetDataProvider: arguments: - - '@EzSystems\Behat\API\ContentData\RandomDataGenerator' - - '@eZ\Publish\Core\FieldType\ImageAsset\AssetMapper' - - '@EzSystems\Behat\API\ContentData\FieldTypeData\ImageDataProvider' - - '@EzSystems\Behat\Core\Behat\ArgumentParser' - - '@eZ\Publish\API\Repository\LocationService' - - '@eZ\Publish\API\Repository\URLAliasService' - - EzSystems\Behat\API\ContentData\FieldTypeData\ImageDataProvider: + - '@Ibexa\Behat\API\ContentData\RandomDataGenerator' + - '@Ibexa\Core\FieldType\ImageAsset\AssetMapper' + - '@Ibexa\Behat\API\ContentData\FieldTypeData\ImageDataProvider' + - '@Ibexa\Behat\Core\Behat\ArgumentParser' + - '@Ibexa\Contracts\Core\Repository\LocationService' + - '@Ibexa\Contracts\Core\Repository\URLAliasService' + + Ibexa\Behat\API\ContentData\FieldTypeData\ImageDataProvider: arguments: $projectDir: '%kernel.project_dir%' - EzSystems\Behat\API\ContentData\FieldTypeData\IntegerDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\IntegerDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\MapDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\MapDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\MediaDataProvider: + Ibexa\Behat\API\ContentData\FieldTypeData\MediaDataProvider: arguments: $projectDir: '%kernel.project_dir%' - EzSystems\Behat\API\ContentData\FieldTypeData\PasswordProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\PasswordProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\RichTextDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\RichTextDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\TextLineDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\TextLineDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\TextBlockDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\TextBlockDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\TimeDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\TimeDataProvider: ~ - EzSystems\Behat\API\ContentData\FieldTypeData\URLDataProvider: ~ + Ibexa\Behat\API\ContentData\FieldTypeData\URLDataProvider: ~ diff --git a/src/bundle/Resources/config/services/limitation_parsers.yaml b/src/bundle/Resources/config/services/limitation_parsers.yaml index 294f7dd7..a9a91cf7 100644 --- a/src/bundle/Resources/config/services/limitation_parsers.yaml +++ b/src/bundle/Resources/config/services/limitation_parsers.yaml @@ -3,57 +3,53 @@ services: autowire: true autoconfigure: true public: false - - _instanceof: - EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface: - tags: ['ezplatform.behat.limitation_parser'] - EzSystems\Behat\API\Context\LimitationParser\ContentTypeLimitationParser: + Ibexa\Behat\API\Context\LimitationParser\ContentTypeLimitationParser: arguments: - - '@ezpublish.api.service.content_type' + - '@ibexa.api.service.content_type' - EzSystems\Behat\API\Context\LimitationParser\FieldGroupLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\FieldGroupLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\LocationLimitationParser: + Ibexa\Behat\API\Context\LimitationParser\LocationLimitationParser: arguments: - - '@ezpublish.api.service.url_alias' - - '@ezpublish.api.service.location' - - '@EzSystems\Behat\Core\Behat\ArgumentParser' + - '@ibexa.api.service.url_alias' + - '@ibexa.api.service.location' + - '@Ibexa\Behat\Core\Behat\ArgumentParser' - EzSystems\Behat\API\Context\LimitationParser\NewSectionLimitationParser: + Ibexa\Behat\API\Context\LimitationParser\NewSectionLimitationParser: arguments: - - '@ezpublish.api.service.section' + - '@ibexa.api.service.section' - EzSystems\Behat\API\Context\LimitationParser\NewStateLimitationParser: + Ibexa\Behat\API\Context\LimitationParser\NewStateLimitationParser: arguments: - - '@ezpublish.api.service.object_state' + - '@ibexa.api.service.object_state' - EzSystems\Behat\API\Context\LimitationParser\ObjectStateLimitationParser: + Ibexa\Behat\API\Context\LimitationParser\ObjectStateLimitationParser: arguments: - - '@ezpublish.api.service.object_state' + - '@ibexa.api.service.object_state' - EzSystems\Behat\API\Context\LimitationParser\LanguageLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\LanguageLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\LimitationParsersCollector: ~ + Ibexa\Behat\API\Context\LimitationParser\LimitationParsersCollector: ~ - EzSystems\Behat\API\Context\LimitationParser\OwnerLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\OwnerLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\ParentContentTypeLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\ParentContentTypeLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\ParentDepthLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\ParentDepthLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\ParentOwnerLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\ParentOwnerLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\ParentUserGroupLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\ParentUserGroupLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\SectionLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\SectionLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\SiteaccessLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\SiteaccessLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\SubtreeLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\SubtreeLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\UserGroupLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\UserGroupLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\WorkflowStageLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\WorkflowStageLimitationParser: ~ - EzSystems\Behat\API\Context\LimitationParser\WorkflowTransitionLimitationParser: ~ + Ibexa\Behat\API\Context\LimitationParser\WorkflowTransitionLimitationParser: ~ diff --git a/src/bundle/Resources/config/services/pages.yaml b/src/bundle/Resources/config/services/pages.yaml index ca321f70..01af82d2 100644 --- a/src/bundle/Resources/config/services/pages.yaml +++ b/src/bundle/Resources/config/services/pages.yaml @@ -10,10 +10,10 @@ services: Ibexa\Behat\Browser\Page\PageRegistry: arguments: - - !tagged_iterator ibexa.testing.browser.page + - !tagged_iterator ibexa.behat.browser.page Ibexa\Behat\Browser\Page\Preview\PagePreviewRegistry: arguments: - - !tagged_iterator ibexa.testing.browser.page_preview + - !tagged_iterator ibexa.behat.browser.page_preview Ibexa\Behat\Browser\Page\Preview\FolderPreview: ~ diff --git a/src/bundle/Resources/config/services/stages.yaml b/src/bundle/Resources/config/services/stages.yaml index 8ca30d8f..708dc180 100644 --- a/src/bundle/Resources/config/services/stages.yaml +++ b/src/bundle/Resources/config/services/stages.yaml @@ -4,26 +4,26 @@ services: autoconfigure: true public: false - EzSystems\Behat\Subscriber\CreateContentDraft: + Ibexa\Behat\Subscriber\CreateContentDraft: tags: - kernel.event_subscriber - EzSystems\Behat\Subscriber\PublishDraft: + Ibexa\Behat\Subscriber\PublishDraft: tags: - kernel.event_subscriber - EzSystems\Behat\Subscriber\EditContent: + Ibexa\Behat\Subscriber\EditContent: tags: - kernel.event_subscriber - EzSystems\Behat\Subscriber\InitialStage: + Ibexa\Behat\Subscriber\InitialStage: tags: - kernel.event_subscriber - EzSystems\Behat\Subscriber\Review: + Ibexa\Behat\Subscriber\Review: tags: - kernel.event_subscriber - EzSystems\Behat\Subscriber\PublishInTheFuture: + Ibexa\Behat\Subscriber\PublishInTheFuture: tags: - kernel.event_subscriber diff --git a/src/bundle/Resources/config/services_dxp.yaml b/src/bundle/Resources/config/services_dxp.yaml index 42da3d0a..29f95baa 100644 --- a/src/bundle/Resources/config/services_dxp.yaml +++ b/src/bundle/Resources/config/services_dxp.yaml @@ -9,9 +9,9 @@ services: autoconfigure: true public: false - EzSystems\BehatBundle\Command\CreateExampleDataCommand: ~ + Ibexa\Bundle\Behat\Command\CreateExampleDataCommand: ~ - EzSystems\BehatBundle\Command\CreateExampleDataManagerCommand: + Ibexa\Bundle\Behat\Command\CreateExampleDataManagerCommand: arguments: - '%kernel.environment%' - '%kernel.project_dir%' diff --git a/src/bundle/Resources/encore/ez.config.manager.js b/src/bundle/Resources/encore/ez.config.manager.js index eb33fd31..f5369c6d 100644 --- a/src/bundle/Resources/encore/ez.config.manager.js +++ b/src/bundle/Resources/encore/ez.config.manager.js @@ -1,10 +1,10 @@ const path = require('path'); -module.exports = (eZConfig, eZConfigManager) => { +module.exports = (ibexaConfig, ibexaConfigManager) => { const addEntry = ([entryName, newItems]) => { - if (eZConfig.entry[entryName]) { - eZConfigManager.add({ - eZConfig, + if (ibexaConfig.entry[entryName]) { + ibexaConfigManager.add({ + ibexaConfig, entryName, newItems, }); @@ -14,12 +14,13 @@ module.exports = (eZConfig, eZConfigManager) => { const dragMockScriptPath = path.resolve(__dirname, '../public/js/scripts/drag-mock.js'); const transitionListenerScriptPath = path.resolve(__dirname, '../public/js/scripts/transition-listener.js'); const scriptsMap = { - 'ezplatform-admin-ui-layout-css': [seleniumDebugStylePath], - 'ezplatform-admin-ui-security-base-css': [seleniumDebugStylePath], - 'ezplatform-page-builder-edit-js': [dragMockScriptPath], - 'ezplatform-form-builder-common-js': [dragMockScriptPath], - 'ezcommerce-shop-pagelayout-css': [seleniumDebugStylePath], - 'ezplatform-admin-ui-layout-js': [transitionListenerScriptPath], + 'ibexa-commerce-shop-pagelayout-css': [seleniumDebugStylePath], + 'ibexa-admin-ui-content-type-edit-js': [dragMockScriptPath], + 'ibexa-admin-ui-layout-css': [seleniumDebugStylePath], + 'ibexa-admin-ui-layout-js': [transitionListenerScriptPath], + 'ibexa-admin-ui-security-base-css': [seleniumDebugStylePath], + 'ibexa-form-builder-common-js': [dragMockScriptPath], + 'ibexa-page-builder-edit-js': [dragMockScriptPath], }; Object.entries(scriptsMap).forEach(addEntry); diff --git a/src/bundle/Resources/views/tests/cache/embed_esi.html.twig b/src/bundle/Resources/views/tests/cache/embed_esi.html.twig index 84d382eb..9c2ca7f1 100644 --- a/src/bundle/Resources/views/tests/cache/embed_esi.html.twig +++ b/src/bundle/Resources/views/tests/cache/embed_esi.html.twig @@ -1,3 +1,3 @@ -{{ ez_render(content) }} +{{ ibexa_render(content) }} -{{ ez_render(embeddedItem, {'viewType': 'line', 'method': 'esi'}) }} +{{ ibexa_render(embeddedItem, {'viewType': 'line', 'method': 'esi'}) }} diff --git a/src/bundle/Resources/views/tests/cache/embed_no_esi.html.twig b/src/bundle/Resources/views/tests/cache/embed_no_esi.html.twig index 4ae126fd..3296f1d8 100644 --- a/src/bundle/Resources/views/tests/cache/embed_no_esi.html.twig +++ b/src/bundle/Resources/views/tests/cache/embed_no_esi.html.twig @@ -1,3 +1,3 @@ -{{ ez_render(content) }} +{{ ibexa_render(content) }} -{{ ez_render(embeddedItem, {'viewType': 'line'}) }} +{{ ibexa_render(embeddedItem, {'viewType': 'line'}) }} diff --git a/src/bundle/Resources/views/tests/cache/embedded.html.twig b/src/bundle/Resources/views/tests/cache/embedded.html.twig index f10968b3..c8758a21 100644 --- a/src/bundle/Resources/views/tests/cache/embedded.html.twig +++ b/src/bundle/Resources/views/tests/cache/embedded.html.twig @@ -1 +1 @@ -{{ ez_render(content) }} +{{ ibexa_render(content) }} diff --git a/src/bundle/Subscriber/EndScenarioSubscriber.php b/src/bundle/Subscriber/EndScenarioSubscriber.php index d955fe87..331589db 100644 --- a/src/bundle/Subscriber/EndScenarioSubscriber.php +++ b/src/bundle/Subscriber/EndScenarioSubscriber.php @@ -10,7 +10,7 @@ use Behat\Behat\EventDispatcher\Event\ExampleTested; use Behat\Behat\EventDispatcher\Event\ScenarioTested; -use EzSystems\Behat\Core\Log\TestLogProvider; +use Ibexa\Behat\Core\Log\TestLogProvider; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class EndScenarioSubscriber implements EventSubscriberInterface diff --git a/src/bundle/Subscriber/StartScenarioSubscriber.php b/src/bundle/Subscriber/StartScenarioSubscriber.php new file mode 100644 index 00000000..1817c591 --- /dev/null +++ b/src/bundle/Subscriber/StartScenarioSubscriber.php @@ -0,0 +1,55 @@ +kernel = $kernel; + $this->width = $width; + $this->height = $height; + } + + public static function getSubscribedEvents() + { + return [ + ScenarioTested::BEFORE => ['resizeWindow', self::PRIORITY], + ExampleTested::BEFORE => ['resizeWindow', self::PRIORITY], + ]; + } + + public function resizeWindow(BeforeScenarioTested $event): void + { + if (!$event->getScenario()->hasTag('javascript') && !$event->getFeature()->hasTag('javascript')) { + return; + } + + $session = $this->kernel->getContainer()->get('behat.mink.default_session'); + if (!$session->isStarted()) { + $session->start(); + } + + $session->resizeWindow($this->width, $this->height); + } +} diff --git a/src/bundle/Templating/Twig/PHPTypeExtension.php b/src/bundle/Templating/Twig/PHPTypeExtension.php index 7eaf4864..b8b370fe 100644 --- a/src/bundle/Templating/Twig/PHPTypeExtension.php +++ b/src/bundle/Templating/Twig/PHPTypeExtension.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\BehatBundle\Templating\Twig; +namespace Ibexa\Bundle\Behat\Templating\Twig; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; @@ -28,3 +28,5 @@ public function getFilters() ]; } } + +class_alias(PHPTypeExtension::class, 'EzSystems\BehatBundle\Templating\Twig\PHPTypeExtension'); diff --git a/src/lib/API/ContentData/ContentDataProvider.php b/src/lib/API/ContentData/ContentDataProvider.php index b9da75ad..687ee642 100644 --- a/src/lib/API/ContentData/ContentDataProvider.php +++ b/src/lib/API/ContentData/ContentDataProvider.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData; +namespace Ibexa\Behat\API\ContentData; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\ContentTypeService; -use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct; -use eZ\Publish\API\Repository\Values\Content\ContentStruct; -use eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct; -use eZ\Publish\API\Repository\Values\ContentType\ContentType; -use EzSystems\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface; +use Ibexa\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\Contracts\Core\Repository\Values\Content\ContentCreateStruct; +use Ibexa\Contracts\Core\Repository\Values\Content\ContentStruct; +use Ibexa\Contracts\Core\Repository\Values\Content\ContentUpdateStruct; +use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; class ContentDataProvider { @@ -24,10 +24,10 @@ class ContentDataProvider private $contentService; - /** @var \EzSystems\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface[] */ + /** @var \Ibexa\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface[] */ private $fieldTypeDataProviders; - /** @var \EzSystems\Behat\API\ContentData\RandomDataGenerator */ + /** @var \Ibexa\Behat\API\ContentData\RandomDataGenerator */ private $randomDataGenerator; public function __construct(ContentTypeService $contentTypeService, ContentService $contentService, RandomDataGenerator $randomDataGenerator) @@ -51,7 +51,6 @@ public function getRandomContentData($language): ContentCreateStruct { $contentType = $this->contentTypeService->loadContentTypeByIdentifier($this->contentTypeIdentifier); $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, $language); - $contentCreateStruct->modificationDate = $this->randomDataGenerator->getRandomDateFromThePast(); return $this->fillContentStructWithData($contentType, $language, $language, $contentCreateStruct); } @@ -116,3 +115,5 @@ private function fillContentStructWithData(ContentType $contentType, string $mai return $contentStruct; } } + +class_alias(ContentDataProvider::class, 'EzSystems\Behat\API\ContentData\ContentDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/AbstractFieldTypeDataProvider.php b/src/lib/API/ContentData/FieldTypeData/AbstractFieldTypeDataProvider.php index 972da8fd..d86f854c 100644 --- a/src/lib/API/ContentData/FieldTypeData/AbstractFieldTypeDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/AbstractFieldTypeDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; use Faker\Generator; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; abstract class AbstractFieldTypeDataProvider implements FieldTypeDataProviderInterface { @@ -35,3 +35,5 @@ protected function getFaker(): Generator return $this->randomDataGenerator->getFaker(); } } + +class_alias(AbstractFieldTypeDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\AbstractFieldTypeDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/AuthorDataProvider.php b/src/lib/API/ContentData/FieldTypeData/AuthorDataProvider.php index a220285d..8d89b3b6 100644 --- a/src/lib/API/ContentData/FieldTypeData/AuthorDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/AuthorDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\Author\Author; -use eZ\Publish\Core\FieldType\Author\Value; +use Ibexa\Core\FieldType\Author\Author; +use Ibexa\Core\FieldType\Author\Value; class AuthorDataProvider extends AbstractFieldTypeDataProvider { @@ -45,3 +45,5 @@ private function getSingleAuthor(string $language = 'eng-GB'): Author return $author; } } + +class_alias(AuthorDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\AuthorDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/BinaryFileDataProvider.php b/src/lib/API/ContentData/FieldTypeData/BinaryFileDataProvider.php index c9956869..6527b9a8 100644 --- a/src/lib/API/ContentData/FieldTypeData/BinaryFileDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/BinaryFileDataProvider.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\BinaryFile\Value; +use Ibexa\Core\FieldType\BinaryFile\Value; class BinaryFileDataProvider implements FieldTypeDataProviderInterface { @@ -45,3 +45,5 @@ public function parseFromString(string $value) return new Value(['inputUri' => $filePath]); } } + +class_alias(BinaryFileDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\BinaryFileDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/BooleanDataProvider.php b/src/lib/API/ContentData/FieldTypeData/BooleanDataProvider.php index 67f6fecf..5f395af7 100644 --- a/src/lib/API/ContentData/FieldTypeData/BooleanDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/BooleanDataProvider.php @@ -6,14 +6,14 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\API\Repository\ContentTypeService; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Contracts\Core\Repository\ContentTypeService; class BooleanDataProvider extends AbstractFieldTypeDataProvider { - /** @var \eZ\Publish\API\Repository\ContentTypeService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */ private $contentTypeService; public function __construct(RandomDataGenerator $randomDataGenerator, ContentTypeService $contentTypeService) @@ -43,3 +43,5 @@ public function parseFromString(string $value) return 'true' === strtolower($value); } } + +class_alias(BooleanDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\BooleanDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/CountryDataProvider.php b/src/lib/API/ContentData/FieldTypeData/CountryDataProvider.php index 70bda62c..807b401d 100644 --- a/src/lib/API/ContentData/FieldTypeData/CountryDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/CountryDataProvider.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\Country\Value; +use Ibexa\Core\FieldType\Country\Value; class CountryDataProvider implements FieldTypeDataProviderInterface { @@ -44,3 +44,5 @@ public function parseFromString(string $value) return new Value([$value => self::COUNTRY_DATA[$value]]); } } + +class_alias(CountryDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\CountryDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/DateDataProvider.php b/src/lib/API/ContentData/FieldTypeData/DateDataProvider.php index b7f67291..e8caee8a 100644 --- a/src/lib/API/ContentData/FieldTypeData/DateDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/DateDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; use DateTime; -use eZ\Publish\Core\FieldType\Date\Value; +use Ibexa\Core\FieldType\Date\Value; class DateDataProvider extends AbstractFieldTypeDataProvider { @@ -28,3 +28,5 @@ public function parseFromString(string $value) return DateTime::createFromFormat('Y-m-d', $value); } } + +class_alias(DateDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\DateDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/DateTimeDataProvider.php b/src/lib/API/ContentData/FieldTypeData/DateTimeDataProvider.php index a359298a..f05867cb 100644 --- a/src/lib/API/ContentData/FieldTypeData/DateTimeDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/DateTimeDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; use DateTime; -use eZ\Publish\Core\FieldType\DateAndTime\Value; +use Ibexa\Core\FieldType\DateAndTime\Value; class DateTimeDataProvider extends AbstractFieldTypeDataProvider { @@ -28,3 +28,5 @@ public function parseFromString(string $value) return DateTime::createFromFormat('Y-m-d H:i:s', $value); } } + +class_alias(DateTimeDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\DateTimeDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/EmailDataProvider.php b/src/lib/API/ContentData/FieldTypeData/EmailDataProvider.php index a224856f..2d9e18ee 100644 --- a/src/lib/API/ContentData/FieldTypeData/EmailDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/EmailDataProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; class EmailDataProvider extends AbstractFieldTypeDataProvider { @@ -22,3 +22,5 @@ public function generateData(string $contentTypeIdentifier, string $fieldIdentif return $this->getFaker()->companyEmail; } } + +class_alias(EmailDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\EmailDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/FieldTypeDataProviderInterface.php b/src/lib/API/ContentData/FieldTypeData/FieldTypeDataProviderInterface.php index 70741976..0b93b240 100644 --- a/src/lib/API/ContentData/FieldTypeData/FieldTypeDataProviderInterface.php +++ b/src/lib/API/ContentData/FieldTypeData/FieldTypeDataProviderInterface.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; interface FieldTypeDataProviderInterface { - public const SERVICE_TAG = 'ezplatform.behat.fieldtype_data_provider'; - public function supports(string $fieldTypeIdentifier): bool; public function generateData(string $contentTypeIdentifier, string $fieldIdentifier, string $language = 'eng-GB'); public function parseFromString(string $value); } + +class_alias(FieldTypeDataProviderInterface::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface'); diff --git a/src/lib/API/ContentData/FieldTypeData/FloatDataProvider.php b/src/lib/API/ContentData/FieldTypeData/FloatDataProvider.php index 12e8c309..097451e0 100644 --- a/src/lib/API/ContentData/FieldTypeData/FloatDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/FloatDataProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; class FloatDataProvider extends AbstractFieldTypeDataProvider { @@ -25,3 +25,5 @@ public function parseFromString(string $value) return (float) $value; } } + +class_alias(FloatDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\FloatDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/ISBNDataProvider.php b/src/lib/API/ContentData/FieldTypeData/ISBNDataProvider.php index 32f507a7..1fdd45df 100644 --- a/src/lib/API/ContentData/FieldTypeData/ISBNDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/ISBNDataProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; class ISBNDataProvider extends AbstractFieldTypeDataProvider { @@ -20,3 +20,5 @@ public function generateData(string $contentTypeIdentifier, string $fieldIdentif return $this->getFaker()->isbn13; } } + +class_alias(ISBNDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\ISBNDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/ImageAssetDataProvider.php b/src/lib/API/ContentData/FieldTypeData/ImageAssetDataProvider.php index df00c03a..02b12045 100644 --- a/src/lib/API/ContentData/FieldTypeData/ImageAssetDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/ImageAssetDataProvider.php @@ -6,42 +6,45 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\Core\FieldType\ImageAsset\AssetMapper; -use eZ\Publish\Core\FieldType\ImageAsset\Value; -use eZ\Publish\Core\MVC\ConfigResolverInterface; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\Core\Behat\ArgumentParser; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; +use Ibexa\Core\FieldType\ImageAsset\AssetMapper; +use Ibexa\Core\FieldType\ImageAsset\Value; class ImageAssetDataProvider extends AbstractFieldTypeDataProvider { /** - * @var \eZ\Publish\Core\FieldType\ImageAsset\AssetMapper + * @var \Ibexa\Core\FieldType\ImageAsset\AssetMapper */ private $assetMapper; + /** * @var ImageDataProvider */ private $imageDataProvider; /** - * @var \EzSystems\Behat\Core\Behat\ArgumentParser + * @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; + /** - * @var \eZ\Publish\API\Repository\LocationService + * @var \Ibexa\Contracts\Core\Repository\LocationService */ private $locationService; + /** - * @var \eZ\Publish\API\Repository\URLAliasService + * @var \Ibexa\Contracts\Core\Repository\URLAliasService */ private $urlAliasService; /** - * @var \eZ\Publish\Core\MVC\ConfigResolverInterface + * @var \Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface */ private $configResolver; @@ -96,3 +99,5 @@ public function parseFromString(string $value) return new Value($location->getContentInfo()->id, $this->getFaker()->realText(100)); } } + +class_alias(ImageAssetDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\ImageAssetDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/ImageDataProvider.php b/src/lib/API/ContentData/FieldTypeData/ImageDataProvider.php index b736d6eb..cce05c56 100644 --- a/src/lib/API/ContentData/FieldTypeData/ImageDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/ImageDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\Image\Value; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Core\FieldType\Image\Value; class ImageDataProvider extends AbstractFieldTypeDataProvider { @@ -70,3 +70,5 @@ public function parseFromString(string $value) ); } } + +class_alias(ImageDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\ImageDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/IntegerDataProvider.php b/src/lib/API/ContentData/FieldTypeData/IntegerDataProvider.php index c7ff1e34..fccd9302 100644 --- a/src/lib/API/ContentData/FieldTypeData/IntegerDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/IntegerDataProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; class IntegerDataProvider extends AbstractFieldTypeDataProvider { @@ -25,3 +25,5 @@ public function parseFromString(string $value) return (int) $value; } } + +class_alias(IntegerDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\IntegerDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/MapDataProvider.php b/src/lib/API/ContentData/FieldTypeData/MapDataProvider.php index 92865c21..8a7458e8 100644 --- a/src/lib/API/ContentData/FieldTypeData/MapDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/MapDataProvider.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\MapLocation\Value; +use Ibexa\Core\FieldType\MapLocation\Value; class MapDataProvider implements FieldTypeDataProviderInterface { @@ -50,3 +50,5 @@ public function parseFromString(string $value) return new Value(self::LOCATION_DATA[$value]); } } + +class_alias(MapDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\MapDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/MatrixDataProvider.php b/src/lib/API/ContentData/FieldTypeData/MatrixDataProvider.php index 6553fbe3..b022f0c3 100644 --- a/src/lib/API/ContentData/FieldTypeData/MatrixDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/MatrixDataProvider.php @@ -6,16 +6,17 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\API\Repository\ContentTypeService; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\EzPlatformMatrixFieldtype\FieldType\Value; -use EzSystems\EzPlatformMatrixFieldtype\FieldType\Value\Row; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\FieldTypeMatrix\FieldType\Value; +use Ibexa\FieldTypeMatrix\FieldType\Value\Row; class MatrixDataProvider extends AbstractFieldTypeDataProvider { private const MAX_NUMBER_OF_ITEMS = 200; + private $contentTypeService; public function __construct(RandomDataGenerator $randomDataGenerator, ContentTypeService $contentTypeService) @@ -91,3 +92,5 @@ private function getRandomEntry($columnIdentifiers) return new Row($values); } } + +class_alias(MatrixDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\MatrixDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/MediaDataProvider.php b/src/lib/API/ContentData/FieldTypeData/MediaDataProvider.php index 7c59eb31..6dc86d4b 100644 --- a/src/lib/API/ContentData/FieldTypeData/MediaDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/MediaDataProvider.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\Media\Value; +use Ibexa\Core\FieldType\Media\Value; class MediaDataProvider implements FieldTypeDataProviderInterface { @@ -55,3 +55,5 @@ public function parseFromString(string $value) return $mediaValue; } } + +class_alias(MediaDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\MediaDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/ObjectRelationDataProvider.php b/src/lib/API/ContentData/FieldTypeData/ObjectRelationDataProvider.php index 2e556a9f..af9ad203 100644 --- a/src/lib/API/ContentData/FieldTypeData/ObjectRelationDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/ObjectRelationDataProvider.php @@ -6,29 +6,30 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\Core\FieldType\Relation\Value; -use EzSystems\Behat\API\Facade\SearchFacade; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\Facade\SearchFacade; +use Ibexa\Behat\Core\Behat\ArgumentParser; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Core\FieldType\Relation\Value; class ObjectRelationDataProvider implements FieldTypeDataProviderInterface { - /** @var \EzSystems\Behat\API\Facade\SearchFacade */ + /** @var \Ibexa\Behat\API\Facade\SearchFacade */ protected $searchFacade; - /** @var \eZ\Publish\API\Repository\ContentService */ + + /** @var \Ibexa\Contracts\Core\Repository\ContentService */ private $contentService; - /** @var \eZ\Publish\API\Repository\LocationService */ + /** @var \Ibexa\Contracts\Core\Repository\LocationService */ private $locationService; - /** @var \eZ\Publish\API\Repository\URLAliasService */ + /** @var \Ibexa\Contracts\Core\Repository\URLAliasService */ private $urlAliasService; - /** @var \EzSystems\Behat\Core\Behat\ArgumentParser */ + /** @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; public function __construct(SearchFacade $searchFacade, ContentService $contentService, LocationService $locationSerice, URLAliasService $urlAliasSerivce, ArgumentParser $argumentParser) @@ -65,3 +66,5 @@ protected function getContentID(string $locationPath) return $location->getContentInfo()->id; } } + +class_alias(ObjectRelationDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\ObjectRelationDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/ObjectRelationListDataProvider.php b/src/lib/API/ContentData/FieldTypeData/ObjectRelationListDataProvider.php index cab3773a..171db2c0 100644 --- a/src/lib/API/ContentData/FieldTypeData/ObjectRelationListDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/ObjectRelationListDataProvider.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\RelationList\Value; +use Ibexa\Core\FieldType\RelationList\Value; class ObjectRelationListDataProvider extends ObjectRelationDataProvider { @@ -32,3 +32,5 @@ public function parseFromString(string $value) return new Value($itemsToAdd); } } + +class_alias(ObjectRelationListDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\ObjectRelationListDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/PasswordProvider.php b/src/lib/API/ContentData/FieldTypeData/PasswordProvider.php index 4434810a..f055b486 100644 --- a/src/lib/API/ContentData/FieldTypeData/PasswordProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/PasswordProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; class PasswordProvider extends AbstractFieldTypeDataProvider { @@ -22,3 +22,5 @@ public function generateData(string $contentTypeIdentifier, string $fieldIdentif return self::DEFAUlT_PASSWORD; } } + +class_alias(PasswordProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\PasswordProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/RichTextDataProvider.php b/src/lib/API/ContentData/FieldTypeData/RichTextDataProvider.php index 6e8f8c6e..82033f0e 100644 --- a/src/lib/API/ContentData/FieldTypeData/RichTextDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/RichTextDataProvider.php @@ -6,26 +6,26 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\API\Facade\SearchFacade; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\API\Facade\SearchFacade; class RichTextDataProvider extends AbstractFieldTypeDataProvider { private const SIMPLE_RICHTEXT_XML = ' -
+
%s
'; private const COMPLEX_RICHTEXT_XML = ' -
+
%s %s
'; /** - * @var \EzSystems\Behat\API\Facade\SearchFacade + * @var \Ibexa\Behat\API\Facade\SearchFacade */ private $searchFacade; @@ -62,3 +62,5 @@ public function parseFromString(string $value) return sprintf(self::SIMPLE_RICHTEXT_XML, $value); } } + +class_alias(RichTextDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\RichTextDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php b/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php index 3fc42db8..844a6002 100644 --- a/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/SelectionDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\API\Repository\ContentTypeService; -use eZ\Publish\Core\FieldType\Selection\Value; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\Core\FieldType\Selection\Value; class SelectionDataProvider implements FieldTypeDataProviderInterface { @@ -50,3 +50,5 @@ public function parseFromString(string $value) return new Value($options); } } + +class_alias(SelectionDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\SelectionDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/TextBlockDataProvider.php b/src/lib/API/ContentData/FieldTypeData/TextBlockDataProvider.php index 89a2566d..73658cda 100644 --- a/src/lib/API/ContentData/FieldTypeData/TextBlockDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/TextBlockDataProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; class TextBlockDataProvider extends AbstractFieldTypeDataProvider { @@ -22,3 +22,5 @@ public function generateData(string $contentTypeIdentifier, string $fieldIdentif return $this->getFaker()->paragraphs(5, true); } } + +class_alias(TextBlockDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\TextBlockDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/TextLineDataProvider.php b/src/lib/API/ContentData/FieldTypeData/TextLineDataProvider.php index 4963e0f9..cf95b421 100644 --- a/src/lib/API/ContentData/FieldTypeData/TextLineDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/TextLineDataProvider.php @@ -6,7 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; + +use Ibexa\Core\FieldType\TextLine\Value; class TextLineDataProvider extends AbstractFieldTypeDataProvider { @@ -15,10 +17,17 @@ public function supports(string $fieldTypeIdentifier): bool return 'ezstring' === $fieldTypeIdentifier; } - public function generateData(string $contentTypeIdentifier, string $fieldIdentifier, string $language = 'eng-GB'): string + public function generateData(string $contentTypeIdentifier, string $fieldIdentifier, string $language = 'eng-GB'): Value { $this->setLanguage($language); - return $this->getFaker()->realText(80, 1); + return new Value($this->getFaker()->realText(80, 1)); + } + + public function parseFromString(string $value): Value + { + return new Value($value); } } + +class_alias(TextLineDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\TextLineDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/TimeDataProvider.php b/src/lib/API/ContentData/FieldTypeData/TimeDataProvider.php index 43d1ee9a..111ed15c 100644 --- a/src/lib/API/ContentData/FieldTypeData/TimeDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/TimeDataProvider.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; use DateTime; -use eZ\Publish\Core\FieldType\Time\Value; +use Ibexa\Core\FieldType\Time\Value; class TimeDataProvider extends AbstractFieldTypeDataProvider { @@ -28,3 +28,5 @@ public function parseFromString(string $value) return Value::fromDateTime(DateTime::createFromFormat('H:i:s', $value)); } } + +class_alias(TimeDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\TimeDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeData/URLDataProvider.php b/src/lib/API/ContentData/FieldTypeData/URLDataProvider.php index f9133a7b..3ac08cc3 100644 --- a/src/lib/API/ContentData/FieldTypeData/URLDataProvider.php +++ b/src/lib/API/ContentData/FieldTypeData/URLDataProvider.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData\FieldTypeData; +namespace Ibexa\Behat\API\ContentData\FieldTypeData; -use eZ\Publish\Core\FieldType\Url\Value; +use Ibexa\Core\FieldType\Url\Value; class URLDataProvider extends AbstractFieldTypeDataProvider { @@ -31,3 +31,5 @@ public function parseFromString(string $value) return new Value($url, $text); } } + +class_alias(URLDataProvider::class, 'EzSystems\Behat\API\ContentData\FieldTypeData\URLDataProvider'); diff --git a/src/lib/API/ContentData/FieldTypeNameConverter.php b/src/lib/API/ContentData/FieldTypeNameConverter.php index bc5afe7b..6558c7a0 100644 --- a/src/lib/API/ContentData/FieldTypeNameConverter.php +++ b/src/lib/API/ContentData/FieldTypeNameConverter.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData; +namespace Ibexa\Behat\API\ContentData; class FieldTypeNameConverter { @@ -41,6 +41,7 @@ class FieldTypeNameConverter 'eztime' => 'Time', 'ezurl' => 'URL', 'ezuser' => 'User account', + 'ibexa_taxonomy_entry_assignment' => 'Taxonomy Entry Assignment', ]; public static function getFieldTypeNameByIdentifier(string $fieldTypeIdentifier): string @@ -53,3 +54,5 @@ public static function getFieldTypeIdentifierByName(string $fieldTypeName): stri return array_search($fieldTypeName, static::$FIELD_TYPE_MAPPING); } } + +class_alias(FieldTypeNameConverter::class, 'EzSystems\Behat\API\ContentData\FieldTypeNameConverter'); diff --git a/src/lib/API/ContentData/RandomDataGenerator.php b/src/lib/API/ContentData/RandomDataGenerator.php index d1afbad5..76570e83 100644 --- a/src/lib/API/ContentData/RandomDataGenerator.php +++ b/src/lib/API/ContentData/RandomDataGenerator.php @@ -6,12 +6,12 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\ContentData; +namespace Ibexa\Behat\API\ContentData; use DateTime; -use eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface; use Faker; use Faker\Generator; +use Ibexa\Core\MVC\Symfony\Locale\LocaleConverterInterface; class RandomDataGenerator { @@ -69,3 +69,5 @@ public function getRandomProbability(): float return random_int(0, 999) / 1000; } } + +class_alias(RandomDataGenerator::class, 'EzSystems\Behat\API\ContentData\RandomDataGenerator'); diff --git a/src/lib/API/Context/ContentContext.php b/src/lib/API/Context/ContentContext.php index 8d2ffd4b..2250ef79 100644 --- a/src/lib/API/Context/ContentContext.php +++ b/src/lib/API/Context/ContentContext.php @@ -6,19 +6,19 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\TableNode; -use EzSystems\Behat\API\Facade\ContentFacade; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\Facade\ContentFacade; +use Ibexa\Behat\Core\Behat\ArgumentParser; class ContentContext implements Context { - /** @var \EzSystems\Behat\API\Facade\ContentFacade */ + /** @var \Ibexa\Behat\API\Facade\ContentFacade */ private $contentFacade; - /** @var \EzSystems\Behat\Core\Behat\ArgumentParser */ + /** @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; public function __construct(ContentFacade $contentFacade, ArgumentParser $argumentParser) @@ -142,3 +142,5 @@ private function parseData(TableNode $contentItemData) return $contentItemData->getHash(); } } + +class_alias(ContentContext::class, 'EzSystems\Behat\API\Context\ContentContext'); diff --git a/src/lib/API/Context/ContentTypeContext.php b/src/lib/API/Context/ContentTypeContext.php index 4806e405..a2730f14 100644 --- a/src/lib/API/Context/ContentTypeContext.php +++ b/src/lib/API/Context/ContentTypeContext.php @@ -6,16 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\TableNode; -use eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionCreateStruct; -use EzSystems\Behat\API\Facade\ContentTypeFacade; +use Ibexa\Behat\API\Facade\ContentTypeFacade; +use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionCreateStruct; class ContentTypeContext implements Context { - /** @var \EzSystems\Behat\API\Facade\ContentTypeFacade */ + /** @var \Ibexa\Behat\API\Facade\ContentTypeFacade */ private $contentTypeFacade; public function __construct(ContentTypeFacade $contentTypeFacade) @@ -76,7 +76,6 @@ private function parseBool(string $value): bool private function parseFieldSettings(string $fieldTypeIdentifier, string $settings) { $parsedSettings = []; - // TODO: Clean this up in the future if needed switch ($fieldTypeIdentifier) { case 'ezcontentquery': return $this->parseContentQuerySettings($settings); @@ -87,6 +86,9 @@ private function parseFieldSettings(string $fieldTypeIdentifier, string $setting case 'ezselection': return $this->parseSelectionSettings($settings); + case 'ibexa_taxonomy_entry_assignment': + return $this->parseTaxonomySettings($settings); + default: return $parsedSettings; } @@ -141,4 +143,11 @@ private function parseContentQuerySettings(string $settings): array return $parsedSettings; } + + private function parseTaxonomySettings(string $settings): array + { + return ['taxonomy' => $settings]; + } } + +class_alias(ContentTypeContext::class, 'EzSystems\Behat\API\Context\ContentTypeContext'); diff --git a/src/lib/API/Context/LanguageContext.php b/src/lib/API/Context/LanguageContext.php index 3b624d62..cf773d49 100644 --- a/src/lib/API/Context/LanguageContext.php +++ b/src/lib/API/Context/LanguageContext.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; -use EzSystems\Behat\API\Facade\LanguageFacade; +use Ibexa\Behat\API\Facade\LanguageFacade; class LanguageContext implements Context { /** - * @var \EzSystems\Behat\API\Facade\LanguageFacade + * @var \Ibexa\Behat\API\Facade\LanguageFacade */ private $languageFacade; @@ -31,3 +31,5 @@ public function createLanguageIfNotExists(string $name, string $languageCode) $this->languageFacade->createLanguageIfNotExists($name, $languageCode); } } + +class_alias(LanguageContext::class, 'EzSystems\Behat\API\Context\LanguageContext'); diff --git a/src/lib/API/Context/LimitationParser/ContentTypeLimitationParser.php b/src/lib/API/Context/LimitationParser/ContentTypeLimitationParser.php index 4a1ec40a..a23e2d0b 100644 --- a/src/lib/API/Context/LimitationParser/ContentTypeLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/ContentTypeLimitationParser.php @@ -6,15 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\ContentTypeService; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\ContentTypeLimitation; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\ContentTypeLimitation; class ContentTypeLimitationParser implements LimitationParserInterface { private $contentTypService; + private $contentTypeNameIdentifierMap; public function __construct(ContentTypeService $contentTypeService) @@ -63,3 +64,5 @@ private function parseCommonContentTypes(string $contentTypeName): string return $contentTypeName; } } + +class_alias(ContentTypeLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\ContentTypeLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/FieldGroupLimitationParser.php b/src/lib/API/Context/LimitationParser/FieldGroupLimitationParser.php index 67f52414..3f45c3a3 100644 --- a/src/lib/API/Context/LimitationParser/FieldGroupLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/FieldGroupLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use Ibexa\Platform\Contracts\Permissions\Repository\Values\User\Limitation\FieldGroupLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Permissions\Repository\Values\User\Limitation\FieldGroupLimitation; class FieldGroupLimitationParser implements LimitationParserInterface { @@ -27,3 +27,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(FieldGroupLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\FieldGroupLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/LanguageLimitationParser.php b/src/lib/API/Context/LimitationParser/LanguageLimitationParser.php index 155974a8..091203d4 100644 --- a/src/lib/API/Context/LimitationParser/LanguageLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/LanguageLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\LanguageLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\LanguageLimitation; class LanguageLimitationParser implements LimitationParserInterface { @@ -25,3 +25,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(LanguageLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\LanguageLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/LimitationParserInterface.php b/src/lib/API/Context/LimitationParser/LimitationParserInterface.php index de7f29bb..e09c1e6a 100644 --- a/src/lib/API/Context/LimitationParser/LimitationParserInterface.php +++ b/src/lib/API/Context/LimitationParser/LimitationParserInterface.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; interface LimitationParserInterface { - public const SERVICE_TAG = 'ezplatform.behat.limitation_parser'; - public function supports(string $limitationType): bool; public function parse(string $limitationValues): Limitation; } + +class_alias(LimitationParserInterface::class, 'EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface'); diff --git a/src/lib/API/Context/LimitationParser/LimitationParsersCollector.php b/src/lib/API/Context/LimitationParser/LimitationParsersCollector.php index 45314e6a..9dc2fda4 100644 --- a/src/lib/API/Context/LimitationParser/LimitationParsersCollector.php +++ b/src/lib/API/Context/LimitationParser/LimitationParsersCollector.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; class LimitationParsersCollector { - /** @var \EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface[] */ + /** @var \Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface[] */ private $limitationParsers; /** - * @param \EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface[] $limitationParsers + * @param \Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface[] $limitationParsers */ public function __construct(array $limitationParsers = []) { @@ -27,10 +27,12 @@ public function addLimitationParser(LimitationParserInterface $limitationParser) } /** - * @return \EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface[] + * @return \Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface[] */ public function getLimitationParsers(): array { return $this->limitationParsers; } } + +class_alias(LimitationParsersCollector::class, 'EzSystems\Behat\API\Context\LimitationParser\LimitationParsersCollector'); diff --git a/src/lib/API/Context/LimitationParser/LocationLimitationParser.php b/src/lib/API/Context/LimitationParser/LocationLimitationParser.php index b1024ddf..b9cc524a 100644 --- a/src/lib/API/Context/LimitationParser/LocationLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/LocationLimitationParser.php @@ -6,18 +6,21 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\LocationLimitation; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\Core\Behat\ArgumentParser; +use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\LocationLimitation; class LocationLimitationParser implements LimitationParserInterface { private $locationService; + private $urlAliasService; + private $argumentParser; public function __construct(URLAliasService $urlAliasService, LocationService $locationService, ArgumentParser $argumentParser) @@ -38,8 +41,13 @@ public function parse(string $limitationValues): Limitation foreach (explode(',', $limitationValues) as $limitationValue) { $parsedUrl = $this->argumentParser->parseUrl($limitationValue); - $urlAlias = $this->urlAliasService->lookup($parsedUrl); - $location = $this->locationService->loadLocation($urlAlias->destination); + try { + $urlAlias = $this->urlAliasService->lookup($parsedUrl); + $location = $this->locationService->loadLocation($urlAlias->destination); + } catch (NotFoundException $exception) { + continue; + } + $values[] = $location->id; } @@ -48,3 +56,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(LocationLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\LocationLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/NewSectionLimitationParser.php b/src/lib/API/Context/LimitationParser/NewSectionLimitationParser.php index 2202896f..6d58b4b3 100644 --- a/src/lib/API/Context/LimitationParser/NewSectionLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/NewSectionLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\SectionService; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\NewSectionLimitation; +use Ibexa\Contracts\Core\Repository\SectionService; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\NewSectionLimitation; class NewSectionLimitationParser implements LimitationParserInterface { @@ -43,3 +43,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(NewSectionLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\NewSectionLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/NewStateLimitationParser.php b/src/lib/API/Context/LimitationParser/NewStateLimitationParser.php index fdab7fbd..e1b93521 100644 --- a/src/lib/API/Context/LimitationParser/NewStateLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/NewStateLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\ObjectStateService; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\NewObjectStateLimitation; +use Ibexa\Contracts\Core\Repository\ObjectStateService; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\NewObjectStateLimitation; class NewStateLimitationParser implements LimitationParserInterface { @@ -60,3 +60,5 @@ protected function parseObjectStateValues($objectStates) return $values; } } + +class_alias(NewStateLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\NewStateLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/ObjectStateLimitationParser.php b/src/lib/API/Context/LimitationParser/ObjectStateLimitationParser.php index b34fc1f9..dd7c86e7 100644 --- a/src/lib/API/Context/LimitationParser/ObjectStateLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/ObjectStateLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\ObjectStateLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\ObjectStateLimitation; class ObjectStateLimitationParser extends NewStateLimitationParser implements LimitationParserInterface { @@ -27,3 +27,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(ObjectStateLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\ObjectStateLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/OwnerLimitationParser.php b/src/lib/API/Context/LimitationParser/OwnerLimitationParser.php index 96e087f9..591dc3ec 100644 --- a/src/lib/API/Context/LimitationParser/OwnerLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/OwnerLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\OwnerLimitation; -use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\OwnerLimitation; +use Ibexa\Core\Base\Exceptions\InvalidArgumentException; class OwnerLimitationParser implements LimitationParserInterface { @@ -30,3 +30,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(OwnerLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\OwnerLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/ParentContentTypeLimitationParser.php b/src/lib/API/Context/LimitationParser/ParentContentTypeLimitationParser.php index e23630ab..48310e3e 100644 --- a/src/lib/API/Context/LimitationParser/ParentContentTypeLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/ParentContentTypeLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\ParentContentTypeLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentContentTypeLimitation; class ParentContentTypeLimitationParser extends ContentTypeLimitationParser { @@ -26,3 +26,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(ParentContentTypeLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\ParentContentTypeLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/ParentDepthLimitationParser.php b/src/lib/API/Context/LimitationParser/ParentDepthLimitationParser.php index b746204e..46402d3e 100644 --- a/src/lib/API/Context/LimitationParser/ParentDepthLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/ParentDepthLimitationParser.php @@ -6,9 +6,9 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; class ParentDepthLimitationParser implements LimitationParserInterface { @@ -25,3 +25,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(ParentDepthLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\ParentDepthLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/ParentOwnerLimitationParser.php b/src/lib/API/Context/LimitationParser/ParentOwnerLimitationParser.php index d4b43496..2fc8e028 100644 --- a/src/lib/API/Context/LimitationParser/ParentOwnerLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/ParentOwnerLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\ParentOwnerLimitation; -use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentOwnerLimitation; +use Ibexa\Core\Base\Exceptions\InvalidArgumentException; class ParentOwnerLimitationParser implements LimitationParserInterface { @@ -31,3 +31,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(ParentOwnerLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\ParentOwnerLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/ParentUserGroupLimitationParser.php b/src/lib/API/Context/LimitationParser/ParentUserGroupLimitationParser.php index 06c5205b..57ff5710 100644 --- a/src/lib/API/Context/LimitationParser/ParentUserGroupLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/ParentUserGroupLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\ParentUserGroupLimitation; -use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentUserGroupLimitation; +use Ibexa\Core\Base\Exceptions\InvalidArgumentException; class ParentUserGroupLimitationParser implements LimitationParserInterface { @@ -31,3 +31,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(ParentUserGroupLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\ParentUserGroupLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/SectionLimitationParser.php b/src/lib/API/Context/LimitationParser/SectionLimitationParser.php index 58dc6af2..379f4a6b 100644 --- a/src/lib/API/Context/LimitationParser/SectionLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/SectionLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\SectionService; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\SectionLimitation; +use Ibexa\Contracts\Core\Repository\SectionService; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\SectionLimitation; class SectionLimitationParser implements LimitationParserInterface { @@ -43,3 +43,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(SectionLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\SectionLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/SiteaccessLimitationParser.php b/src/lib/API/Context/LimitationParser/SiteaccessLimitationParser.php index 274aaf56..f7a31826 100644 --- a/src/lib/API/Context/LimitationParser/SiteaccessLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/SiteaccessLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\SiteAccessLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\SiteAccessLimitation; class SiteaccessLimitationParser implements LimitationParserInterface { @@ -32,3 +32,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(SiteaccessLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\SiteaccessLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/SubtreeLimitationParser.php b/src/lib/API/Context/LimitationParser/SubtreeLimitationParser.php index 0631e371..baa7a381 100644 --- a/src/lib/API/Context/LimitationParser/SubtreeLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/SubtreeLimitationParser.php @@ -6,16 +6,17 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\SubtreeLimitation; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\SubtreeLimitation; class SubtreeLimitationParser implements LimitationParserInterface { private $locationService; + private $urlAliasService; public function __construct(URLAliasService $urlAliasService, LocationService $locationService) @@ -44,3 +45,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(SubtreeLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\SubtreeLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/UserGroupLimitationParser.php b/src/lib/API/Context/LimitationParser/UserGroupLimitationParser.php index 72d3c086..81fa0c36 100644 --- a/src/lib/API/Context/LimitationParser/UserGroupLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/UserGroupLimitationParser.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use eZ\Publish\API\Repository\Values\User\Limitation\UserGroupLimitation; -use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\UserGroupLimitation; +use Ibexa\Core\Base\Exceptions\InvalidArgumentException; class UserGroupLimitationParser implements LimitationParserInterface { @@ -30,3 +30,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(UserGroupLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\UserGroupLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/WorkflowStageLimitationParser.php b/src/lib/API/Context/LimitationParser/WorkflowStageLimitationParser.php index 6e81b102..8a5537df 100644 --- a/src/lib/API/Context/LimitationParser/WorkflowStageLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/WorkflowStageLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use EzSystems\EzPlatformWorkflow\Value\Limitation\WorkflowStageLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Workflow\Value\Limitation\WorkflowStageLimitation; class WorkflowStageLimitationParser implements LimitationParserInterface { @@ -27,3 +27,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(WorkflowStageLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\WorkflowStageLimitationParser'); diff --git a/src/lib/API/Context/LimitationParser/WorkflowTransitionLimitationParser.php b/src/lib/API/Context/LimitationParser/WorkflowTransitionLimitationParser.php index ecd4053d..667cd4dc 100644 --- a/src/lib/API/Context/LimitationParser/WorkflowTransitionLimitationParser.php +++ b/src/lib/API/Context/LimitationParser/WorkflowTransitionLimitationParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context\LimitationParser; +namespace Ibexa\Behat\API\Context\LimitationParser; -use eZ\Publish\API\Repository\Values\User\Limitation; -use EzSystems\EzPlatformWorkflow\Value\Limitation\WorkflowTransitionLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation; +use Ibexa\Workflow\Value\Limitation\WorkflowTransitionLimitation; class WorkflowTransitionLimitationParser implements LimitationParserInterface { @@ -27,3 +27,5 @@ public function parse(string $limitationValues): Limitation ); } } + +class_alias(WorkflowTransitionLimitationParser::class, 'EzSystems\Behat\API\Context\LimitationParser\WorkflowTransitionLimitationParser'); diff --git a/src/lib/API/Context/ObjectStateContext.php b/src/lib/API/Context/ObjectStateContext.php index 8ab38af7..b4d7fe4a 100644 --- a/src/lib/API/Context/ObjectStateContext.php +++ b/src/lib/API/Context/ObjectStateContext.php @@ -6,16 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\TableNode; -use eZ\Publish\API\Repository\Exceptions\InvalidArgumentException; -use eZ\Publish\API\Repository\ObjectStateService; +use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; +use Ibexa\Contracts\Core\Repository\ObjectStateService; class ObjectStateContext implements Context { - /** @var \eZ\Publish\API\Repository\ObjectStateService */ + /** @var \Ibexa\Contracts\Core\Repository\ObjectStateService */ private $objectStateService; public function __construct(ObjectStateService $objectStateService) @@ -46,3 +46,5 @@ public function objectStateWithIdentifierExists(string $objectStateGroupName, st } } } + +class_alias(ObjectStateContext::class, 'EzSystems\Behat\API\Context\ObjectStateContext'); diff --git a/src/lib/API/Context/RoleContext.php b/src/lib/API/Context/RoleContext.php index 75700c2f..8ea3fe92 100644 --- a/src/lib/API/Context/RoleContext.php +++ b/src/lib/API/Context/RoleContext.php @@ -6,19 +6,19 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\TableNode; -use EzSystems\Behat\API\Facade\RoleFacade; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\Facade\RoleFacade; +use Ibexa\Behat\Core\Behat\ArgumentParser; class RoleContext implements Context { - /** @var \EzSystems\Behat\API\Facade\RoleFacade */ + /** @var \Ibexa\Behat\API\Facade\RoleFacade */ private $roleFacade; - /** @var \EzSystems\Behat\Core\Behat\ArgumentParser */ + /** @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; public function __construct(RoleFacade $roleFacade, ArgumentParser $argumentParser) @@ -78,3 +78,5 @@ public function addPolicyToRoleWithLimitation(string $module, string $function, $this->roleFacade->addPolicyToRole($roleName, $module, $function, $parsedLimitations); } } + +class_alias(RoleContext::class, 'EzSystems\Behat\API\Context\RoleContext'); diff --git a/src/lib/API/Context/TestContext.php b/src/lib/API/Context/TestContext.php index c4699110..a72caf45 100644 --- a/src/lib/API/Context/TestContext.php +++ b/src/lib/API/Context/TestContext.php @@ -6,15 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; class TestContext implements Context { private $permissionResolver; + private $userService; public function __construct(UserService $userService, PermissionResolver $permissionResolver) @@ -40,3 +41,5 @@ public function loginAdminBeforeScenarioHook() $this->iAmLoggedAsApiUser('admin'); } } + +class_alias(TestContext::class, 'EzSystems\Behat\API\Context\TestContext'); diff --git a/src/lib/API/Context/TrashContext.php b/src/lib/API/Context/TrashContext.php index d8f04cc8..204e95f2 100644 --- a/src/lib/API/Context/TrashContext.php +++ b/src/lib/API/Context/TrashContext.php @@ -6,18 +6,18 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; -use EzSystems\Behat\API\Facade\TrashFacade; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\Facade\TrashFacade; +use Ibexa\Behat\Core\Behat\ArgumentParser; class TrashContext implements Context { - /** @var \EzSystems\Behat\API\Facade\TrashFacade */ + /** @var \Ibexa\Behat\API\Facade\TrashFacade */ private $trashFacade; - /** @var \EzSystems\Behat\Core\Behat\ArgumentParser */ + /** @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; public function __construct(TrashFacade $trashFacade, ArgumentParser $argumentParser) @@ -37,3 +37,5 @@ public function iSendToTheTrash($locationURL) $this->trashFacade->trash($locationURL); } } + +class_alias(TrashContext::class, 'EzSystems\Behat\API\Context\TrashContext'); diff --git a/src/lib/API/Context/UserContext.php b/src/lib/API/Context/UserContext.php index 1fda2880..65ee035a 100644 --- a/src/lib/API/Context/UserContext.php +++ b/src/lib/API/Context/UserContext.php @@ -6,19 +6,19 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Context; +namespace Ibexa\Behat\API\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\TableNode; -use EzSystems\Behat\API\Facade\UserFacade; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\Facade\UserFacade; +use Ibexa\Behat\Core\Behat\ArgumentParser; class UserContext implements Context { - /** @var \EzSystems\Behat\API\Facade\UserFacade */ + /** @var \Ibexa\Behat\API\Facade\UserFacade */ private $userFacade; - /** @var \EzSystems\Behat\Core\Behat\ArgumentParser */ + /** @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; public function __construct(UserFacade $userFacade, ArgumentParser $argumentParser) @@ -71,3 +71,5 @@ public function assignUserGroupToRole(string $userGroupName, string $roleName, T $this->userFacade->assignUserGroupToRole($userGroupName, $roleName, $roleLimitation); } } + +class_alias(UserContext::class, 'EzSystems\Behat\API\Context\UserContext'); diff --git a/src/lib/API/Facade/ContentFacade.php b/src/lib/API/Facade/ContentFacade.php index 400b0212..0fd82435 100644 --- a/src/lib/API/Facade/ContentFacade.php +++ b/src/lib/API/Facade/ContentFacade.php @@ -6,38 +6,38 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; - -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\Exceptions\NotFoundException; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\Repository; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\API\Repository\Values\Content\Content; -use eZ\Publish\API\Repository\Values\Content\Location; -use eZ\Publish\API\Repository\Values\Content\URLAlias; -use EzSystems\Behat\API\ContentData\ContentDataProvider; +namespace Ibexa\Behat\API\Facade; + use FOS\HttpCacheBundle\CacheManager; +use Ibexa\Behat\API\ContentData\ContentDataProvider; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\Repository; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Contracts\Core\Repository\Values\Content\Content; +use Ibexa\Contracts\Core\Repository\Values\Content\Location; +use Ibexa\Contracts\Core\Repository\Values\Content\URLAlias; use PHPUnit\Framework\Assert; class ContentFacade { - /** @var \eZ\Publish\API\Repository\ContentService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentService */ private $contentService; - /** @var \eZ\Publish\API\Repository\LocationService */ + /** @var \Ibexa\Contracts\Core\Repository\LocationService */ private $locationService; - /** @var \eZ\Publish\API\Repository\URLAliasService */ + /** @var \Ibexa\Contracts\Core\Repository\URLAliasService */ private $urlAliasService; - /** @var \EzSystems\Behat\API\ContentData\ContentDataProvider */ + /** @var \Ibexa\Behat\API\ContentData\ContentDataProvider */ private $contentDataProvider; /** @var \FOS\HttpCacheBundle\CacheManager */ private $cacheManager; - /** @var \eZ\Publish\API\Repository\Repository */ + /** @var \Ibexa\Contracts\Core\Repository\Repository */ private $repository; public function __construct( @@ -150,3 +150,5 @@ private function contentExists(string $contentUrl): bool } } } + +class_alias(ContentFacade::class, 'EzSystems\Behat\API\Facade\ContentFacade'); diff --git a/src/lib/API/Facade/ContentTypeFacade.php b/src/lib/API/Facade/ContentTypeFacade.php index 5348985c..c4c90572 100644 --- a/src/lib/API/Facade/ContentTypeFacade.php +++ b/src/lib/API/Facade/ContentTypeFacade.php @@ -6,13 +6,13 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; +namespace Ibexa\Behat\API\Facade; -use eZ\Publish\API\Repository\ContentTypeService; -use eZ\Publish\API\Repository\Exceptions\NotFoundException; -use eZ\Publish\API\Repository\Values\ContentType\ContentType; -use eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup; -use EzSystems\Behat\API\ContentData\FieldTypeNameConverter; +use Ibexa\Behat\API\ContentData\FieldTypeNameConverter; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; +use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup; use Ibexa\Core\Persistence\Cache\Identifier\CacheIdentifierGeneratorInterface; use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface; @@ -22,7 +22,7 @@ class ContentTypeFacade private const CONTENT_TYPE_LIST_BY_GROUP_IDENTIFIER = 'content_type_list_by_group'; - /** @var \eZ\Publish\API\Repository\ContentTypeService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */ private $contentTypeService; /** @var \Symfony\Component\Cache\Adapter\TagAwareAdapterInterface */ @@ -35,7 +35,7 @@ public function __construct( ContentTypeService $contentTypeService, TagAwareAdapterInterface $cachePool, CacheIdentifierGeneratorInterface $cacheIdentifierGenerator - ) { + ) { $this->contentTypeService = $contentTypeService; $this->cachePool = $cachePool; $this->cacheIdentifierGenerator = $cacheIdentifierGenerator; @@ -114,3 +114,5 @@ private function assertContentTypeExistsInGroup(string $contentTypeIdentifier, C } } } + +class_alias(ContentTypeFacade::class, 'EzSystems\Behat\API\Facade\ContentTypeFacade'); diff --git a/src/lib/API/Facade/LanguageFacade.php b/src/lib/API/Facade/LanguageFacade.php index 602103fa..0a0a155e 100644 --- a/src/lib/API/Facade/LanguageFacade.php +++ b/src/lib/API/Facade/LanguageFacade.php @@ -6,14 +6,14 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; +namespace Ibexa\Behat\API\Facade; -use eZ\Publish\API\Repository\Exceptions\NotFoundException; -use eZ\Publish\API\Repository\LanguageService; +use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Repository\LanguageService; class LanguageFacade { - /** @var \eZ\Publish\API\Repository\LanguageService */ + /** @var \Ibexa\Contracts\Core\Repository\LanguageService */ private $languageService; public function __construct(LanguageService $languageService) @@ -39,3 +39,5 @@ public function createLanguage(string $name, string $languageCode) $this->languageService->createLanguage($languageCreateStruct); } } + +class_alias(LanguageFacade::class, 'EzSystems\Behat\API\Facade\LanguageFacade'); diff --git a/src/lib/API/Facade/RoleFacade.php b/src/lib/API/Facade/RoleFacade.php index 6e4d85af..29cc44c6 100644 --- a/src/lib/API/Facade/RoleFacade.php +++ b/src/lib/API/Facade/RoleFacade.php @@ -6,18 +6,18 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; +namespace Ibexa\Behat\API\Facade; -use eZ\Publish\API\Repository\Exceptions\NotFoundException; -use eZ\Publish\API\Repository\RoleService; -use EzSystems\Behat\API\Context\LimitationParser\LimitationParsersCollector; +use Ibexa\Behat\API\Context\LimitationParser\LimitationParsersCollector; +use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Repository\RoleService; class RoleFacade { - /** @var \eZ\Publish\API\Repository\RoleService */ + /** @var \Ibexa\Contracts\Core\Repository\RoleService */ private $roleService; - /** @var \EzSystems\Behat\API\Context\LimitationParser\LimitationParsersCollector */ + /** @var \Ibexa\Behat\API\Context\LimitationParser\LimitationParsersCollector */ private $limitationParsersCollector; public function __construct(RoleService $roleService, LimitationParsersCollector $limitationParsersCollector) @@ -62,10 +62,12 @@ public function roleExist($roleName): bool } /** - * @return \EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface[] + * @return \Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface[] */ public function getLimitationParsers(): array { return $this->limitationParsersCollector->getLimitationParsers(); } } + +class_alias(RoleFacade::class, 'EzSystems\Behat\API\Facade\RoleFacade'); diff --git a/src/lib/API/Facade/SearchFacade.php b/src/lib/API/Facade/SearchFacade.php index 4f1fcdf3..96e995d2 100644 --- a/src/lib/API/Facade/SearchFacade.php +++ b/src/lib/API/Facade/SearchFacade.php @@ -6,33 +6,34 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; - -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\SearchService; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\API\Repository\Values\Content\LocationQuery; -use eZ\Publish\API\Repository\Values\Content\Query; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LocationId; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAnd; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalNot; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Subtree; -use eZ\Publish\API\Repository\Values\Content\URLAlias; +namespace Ibexa\Behat\API\Facade; + +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\SearchService; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LocationId; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalNot; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Subtree; +use Ibexa\Contracts\Core\Repository\Values\Content\URLAlias; use PHPUnit\Framework\Assert; class SearchFacade { - /** @var \eZ\Publish\API\Repository\LocationService */ + /** @var \Ibexa\Contracts\Core\Repository\LocationService */ private $locationService; - /** @var \eZ\Publish\API\Repository\URLAliasService */ + /** @var \Ibexa\Contracts\Core\Repository\URLAliasService */ private $urlAliasService; - /** @var \eZ\Publish\API\Repository\SearchService */ + /** @var \Ibexa\Contracts\Core\Repository\SearchService */ private $searchService; + /** - * @var \eZ\Publish\API\Repository\ContentService + * @var \Ibexa\Contracts\Core\Repository\ContentService */ private $contentService; @@ -103,3 +104,5 @@ public function getRandomLocationID(): int return $this->contentService->loadContent($contentId)->contentInfo->mainLocationId; } } + +class_alias(SearchFacade::class, 'EzSystems\Behat\API\Facade\SearchFacade'); diff --git a/src/lib/API/Facade/TrashFacade.php b/src/lib/API/Facade/TrashFacade.php index e8590156..1a737ce4 100644 --- a/src/lib/API/Facade/TrashFacade.php +++ b/src/lib/API/Facade/TrashFacade.php @@ -6,23 +6,23 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; +namespace Ibexa\Behat\API\Facade; -use eZ\Publish\API\Repository\LocationService; -use eZ\Publish\API\Repository\TrashService; -use eZ\Publish\API\Repository\URLAliasService; -use eZ\Publish\API\Repository\Values\Content\URLAlias; +use Ibexa\Contracts\Core\Repository\LocationService; +use Ibexa\Contracts\Core\Repository\TrashService; +use Ibexa\Contracts\Core\Repository\URLAliasService; +use Ibexa\Contracts\Core\Repository\Values\Content\URLAlias; use PHPUnit\Framework\Assert; class TrashFacade { - /** @var \eZ\Publish\API\Repository\LocationService */ + /** @var \Ibexa\Contracts\Core\Repository\LocationService */ private $locationService; - /** @var \eZ\Publish\API\Repository\URLAliasService */ + /** @var \Ibexa\Contracts\Core\Repository\URLAliasService */ private $urlAliasService; - /** @var \eZ\Publish\API\Repository\TrashService */ + /** @var \Ibexa\Contracts\Core\Repository\TrashService */ private $trashService; public function __construct(LocationService $locationService, URLAliasService $urlAliasService, TrashService $trashService) @@ -42,3 +42,5 @@ public function trash(string $locationURL) $this->trashService->trash($location); } } + +class_alias(TrashFacade::class, 'EzSystems\Behat\API\Facade\TrashFacade'); diff --git a/src/lib/API/Facade/UserFacade.php b/src/lib/API/Facade/UserFacade.php index f72d0145..6d343d25 100644 --- a/src/lib/API/Facade/UserFacade.php +++ b/src/lib/API/Facade/UserFacade.php @@ -6,39 +6,40 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\API\Facade; - -use eZ\Publish\API\Repository\ContentTypeService; -use eZ\Publish\API\Repository\RoleService; -use eZ\Publish\API\Repository\SearchService; -use eZ\Publish\API\Repository\UserService; -use eZ\Publish\API\Repository\Values\Content\Query; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion; -use eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation; -use eZ\Publish\API\Repository\Values\User\UserGroup; -use eZ\Publish\Core\Base\Exceptions\NotFoundException; -use EzSystems\Behat\API\ContentData\FieldTypeData\PasswordProvider; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; +namespace Ibexa\Behat\API\Facade; + +use Ibexa\Behat\API\ContentData\FieldTypeData\PasswordProvider; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Contracts\Core\Repository\ContentTypeService; +use Ibexa\Contracts\Core\Repository\RoleService; +use Ibexa\Contracts\Core\Repository\SearchService; +use Ibexa\Contracts\Core\Repository\UserService; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\User\Limitation\RoleLimitation; +use Ibexa\Contracts\Core\Repository\Values\User\UserGroup; +use Ibexa\Core\Base\Exceptions\NotFoundException; class UserFacade { public const USER_CONTENT_TYPE_IDENTIFIER = 'user'; public const USERGROUP_CONTENT_IDENTIFIER = 'user_group'; public const ROOT_USERGROUP_CONTENT_ID = 4; - /** @var \eZ\Publish\API\Repository\UserService */ + + /** @var \Ibexa\Contracts\Core\Repository\UserService */ private $userService; - /** @var \eZ\Publish\API\Repository\ContentTypeService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */ private $contentTypeService; - /** @var \eZ\Publish\API\Repository\RoleService */ + /** @var \Ibexa\Contracts\Core\Repository\RoleService */ private $roleService; - /** @var \eZ\Publish\API\Repository\SearchService */ + /** @var \Ibexa\Contracts\Core\Repository\SearchService */ private $searchService; /** - * @var \EzSystems\Behat\API\ContentData\RandomDataGenerator + * @var \Ibexa\Behat\API\ContentData\RandomDataGenerator */ private $randomDataGenerator; @@ -137,7 +138,7 @@ private function loadLegacyUserGroupByName(string $userGroupName): UserGroup $result = $this->searchService->findContent($query); foreach ($result->searchHits as $searchHit) { - /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */ + /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ $content = $searchHit->valueObject; if ($content->contentInfo->name === $userGroupName) { @@ -148,3 +149,5 @@ private function loadLegacyUserGroupByName(string $userGroupName): UserGroup throw new NotFoundException('User Group', $userGroupName); } } + +class_alias(UserFacade::class, 'EzSystems\Behat\API\Facade\UserFacade'); diff --git a/src/lib/Browser/Assert/CollectionAssert.php b/src/lib/Browser/Assert/CollectionAssert.php index e3c4b597..7119d9b9 100644 --- a/src/lib/Browser/Assert/CollectionAssert.php +++ b/src/lib/Browser/Assert/CollectionAssert.php @@ -36,11 +36,11 @@ public function isEmpty(): ElementCollectionInterface Assert::assertTrue( $this->elementCollection->empty(), sprintf( - "Failed asserting that Collection created with %s locator '%s': '%s' is empty", - $this->locator->getType(), - $this->locator->getIdentifier(), - $this->locator->getSelector() - ) + "Failed asserting that Collection created with %s locator '%s': '%s' is empty", + $this->locator->getType(), + $this->locator->getIdentifier(), + $this->locator->getSelector() + ) ); return $this->elementCollection; diff --git a/src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php b/src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php index fb0101fd..7873a299 100644 --- a/src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php +++ b/src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php @@ -8,9 +8,9 @@ namespace Ibexa\Behat\Browser\Assert\Debug\Interactive; -use EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait; use Ibexa\Behat\Browser\Assert\CollectionAssertInterface; use Ibexa\Behat\Browser\Element\ElementCollectionInterface; +use Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; use PHPUnit\Framework\ExpectationFailedException; class CollectionAssert implements CollectionAssertInterface diff --git a/src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php b/src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php index eddfddf8..17e21214 100644 --- a/src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php +++ b/src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php @@ -8,9 +8,9 @@ namespace Ibexa\Behat\Browser\Assert\Debug\Interactive; -use EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait; use Ibexa\Behat\Browser\Assert\ElementAssertInterface; use Ibexa\Behat\Browser\Element\ElementInterface; +use Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; use PHPUnit\Framework\ExpectationFailedException; class ElementAssert implements ElementAssertInterface diff --git a/src/lib/Browser/Assert/ElementAssert.php b/src/lib/Browser/Assert/ElementAssert.php index 37a3ecd1..a133212a 100644 --- a/src/lib/Browser/Assert/ElementAssert.php +++ b/src/lib/Browser/Assert/ElementAssert.php @@ -18,6 +18,7 @@ class ElementAssert implements ElementAssertInterface * @var \Ibexa\Behat\Browser\Locator\LocatorInterface */ private $locator; + /** * @var \Ibexa\Behat\Browser\Element\ElementInterface */ @@ -88,7 +89,8 @@ public function hasClass(string $expectedClass): ElementInterface { $actualClass = $this->element->getAttribute('class'); - Assert::assertTrue($this->element->hasClass($expectedClass), + Assert::assertTrue( + $this->element->hasClass($expectedClass), sprintf( "Failed asserting that element with %s locator '%s': '%s' has '%s' class, instead class is '%s'", $this->locator->getType(), diff --git a/src/lib/Browser/Context/AuthenticationContext.php b/src/lib/Browser/Context/AuthenticationContext.php index 807519d1..61ab5401 100644 --- a/src/lib/Browser/Context/AuthenticationContext.php +++ b/src/lib/Browser/Context/AuthenticationContext.php @@ -9,7 +9,7 @@ namespace Ibexa\Behat\Browser\Context; use Behat\MinkExtension\Context\RawMinkContext; -use EzSystems\Behat\API\ContentData\FieldTypeData\PasswordProvider; +use Ibexa\Behat\API\ContentData\FieldTypeData\PasswordProvider; use Ibexa\Behat\Browser\Page\LoginPage; use Ibexa\Behat\Browser\Page\RedirectLoginPage; @@ -19,6 +19,7 @@ class AuthenticationContext extends RawMinkContext * @var \Ibexa\Behat\Browser\Page\LoginPage */ private $loginPage; + /** * @var \Ibexa\Behat\Browser\Page\RedirectLoginPage */ diff --git a/src/lib/Browser/Context/BrowserContext.php b/src/lib/Browser/Context/BrowserContext.php index 30c71e23..255c3d75 100644 --- a/src/lib/Browser/Context/BrowserContext.php +++ b/src/lib/Browser/Context/BrowserContext.php @@ -11,12 +11,12 @@ use Behat\Gherkin\Node\TableNode; use Behat\MinkExtension\Context\RawMinkContext; use DMore\ChromeDriver\ChromeDriver; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\Core\Behat\ArgumentParser; use PHPUnit\Framework\Assert; class BrowserContext extends RawMinkContext { - /** @var \EzSystems\Behat\Core\Behat\ArgumentParser */ + /** @var \Ibexa\Behat\Core\Behat\ArgumentParser */ private $argumentParser; public function __construct(ArgumentParser $argumentParser) diff --git a/src/lib/Browser/Context/DebuggingContext.php b/src/lib/Browser/Context/DebuggingContext.php index 7893a46f..319dfea6 100644 --- a/src/lib/Browser/Context/DebuggingContext.php +++ b/src/lib/Browser/Context/DebuggingContext.php @@ -14,9 +14,9 @@ use Behat\Behat\Hook\Scope\BeforeStepScope; use Behat\MinkExtension\Context\RawMinkContext; use Behat\Testwork\Tester\Result\TestResult; -use EzSystems\Behat\Core\Log\TestLogProvider; use Ibexa\Behat\Core\Log\Failure\TestFailureData; use Ibexa\Behat\Core\Log\KnownIssuesRegistry; +use Ibexa\Behat\Core\Log\TestLogProvider; use Psr\Log\LoggerInterface; class DebuggingContext extends RawMinkContext diff --git a/src/lib/Browser/Element/BaseElement.php b/src/lib/Browser/Element/BaseElement.php index faf33c83..9c52f53e 100644 --- a/src/lib/Browser/Element/BaseElement.php +++ b/src/lib/Browser/Element/BaseElement.php @@ -89,6 +89,8 @@ function () use ($locator) { $wrappedElement = $this->elementFactory->createElement($this->elementFactory, $locator, $foundMinkElement); if ($locator->elementMeetsCriteria($wrappedElement)) { + $wrappedElement->setTimeout($this->getTimeout()); + return $wrappedElement; } } diff --git a/src/lib/Browser/Element/Condition/ElementHasTextCondition.php b/src/lib/Browser/Element/Condition/ElementHasTextCondition.php new file mode 100644 index 00000000..46b3ea53 --- /dev/null +++ b/src/lib/Browser/Element/Condition/ElementHasTextCondition.php @@ -0,0 +1,67 @@ +searchedNode = $searchedNode; + $this->elementLocator = $elementLocator; + $this->expectedText = $expectedText; + } + + public function isMet(): bool + { + $currentTimeout = $this->searchedNode->getTimeout(); + $this->searchedNode->setTimeout(0); + $elements = $this->searchedNode->findAll($this->elementLocator); + $this->searchedNode->setTimeout($currentTimeout); + $this->foundElementsText = $elements->mapBy(new ElementTextMapper()); + + return in_array($this->expectedText, $this->foundElementsText); + } + + public function getErrorMessage(BaseElementInterface $invokingElement): string + { + return sprintf( + "The expected text '%s' matching %s locator '%s': '%s' was not found. Timeout value: %d seconds. Found values: %s", + $this->expectedText, + strtoupper($this->elementLocator->getType()), + $this->elementLocator->getIdentifier(), + $this->elementLocator->getSelector(), + $invokingElement->getTimeout(), + implode(',', $this->foundElementsText) + ); + } +} diff --git a/src/lib/Browser/Element/Condition/ElementTransitionHasEndedCondition.php b/src/lib/Browser/Element/Condition/ElementTransitionHasEndedCondition.php index 6f7fd3f8..f14b0e34 100644 --- a/src/lib/Browser/Element/Condition/ElementTransitionHasEndedCondition.php +++ b/src/lib/Browser/Element/Condition/ElementTransitionHasEndedCondition.php @@ -56,7 +56,7 @@ public function getErrorMessage(BaseElementInterface $invokingElement): string ) : sprintf( - "Transition has not started at all for element with %s locator '%s': '%s'. Please make sure the condition is used on the correct element. Timeout value: %d seconds.", + "Transition has not started at all for element with %s locator '%s': '%s'. Please make sure that you have performed composer run post-install-cmd command before running tests locally and make sure that the condition is used on the correct element. Timeout value: %d seconds.", strtoupper($this->elementLocator->getType()), $this->elementLocator->getIdentifier(), $this->elementLocator->getSelector(), diff --git a/src/lib/Browser/Element/Debug/Highlighting/BaseElement.php b/src/lib/Browser/Element/Debug/Highlighting/BaseElement.php index f3f1e738..ed7e69fb 100644 --- a/src/lib/Browser/Element/Debug/Highlighting/BaseElement.php +++ b/src/lib/Browser/Element/Debug/Highlighting/BaseElement.php @@ -118,9 +118,9 @@ private function setAttribute(ElementInterface $element, string $attribute, stri private function getElementScript(ElementInterface $element): string { return sprintf( - 'document.evaluate("%s", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue', - $element->getXPath() - ); + 'document.evaluate("%s", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue', + $element->getXPath() + ); } private function getRandomColor(): string diff --git a/src/lib/Browser/Element/Debug/Interactive/BaseElement.php b/src/lib/Browser/Element/Debug/Interactive/BaseElement.php index 09743a71..1cea0037 100644 --- a/src/lib/Browser/Element/Debug/Interactive/BaseElement.php +++ b/src/lib/Browser/Element/Debug/Interactive/BaseElement.php @@ -8,13 +8,13 @@ namespace Ibexa\Behat\Browser\Element\Debug\Interactive; -use EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait; use Ibexa\Behat\Browser\Element\BaseElementInterface; use Ibexa\Behat\Browser\Element\Condition\ConditionInterface; use Ibexa\Behat\Browser\Element\ElementCollectionInterface; use Ibexa\Behat\Browser\Element\ElementInterface; use Ibexa\Behat\Browser\Exception\TimeoutException; use Ibexa\Behat\Browser\Locator\LocatorInterface; +use Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; class BaseElement implements BaseElementInterface { diff --git a/src/lib/Browser/Element/Debug/Interactive/Element.php b/src/lib/Browser/Element/Debug/Interactive/Element.php index 09c7d6ce..69b41234 100644 --- a/src/lib/Browser/Element/Debug/Interactive/Element.php +++ b/src/lib/Browser/Element/Debug/Interactive/Element.php @@ -10,10 +10,10 @@ use Behat\Mink\Session; use Exception; -use EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait; use Ibexa\Behat\Browser\Assert\Debug\Interactive\ElementAssert as InteractiveElementAssert; use Ibexa\Behat\Browser\Assert\ElementAssertInterface; use Ibexa\Behat\Browser\Element\ElementInterface; +use Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; final class Element extends BaseElement implements ElementInterface { diff --git a/src/lib/Browser/Element/Debug/Interactive/ElementCollection.php b/src/lib/Browser/Element/Debug/Interactive/ElementCollection.php index 9f581d7d..ed3845a1 100644 --- a/src/lib/Browser/Element/Debug/Interactive/ElementCollection.php +++ b/src/lib/Browser/Element/Debug/Interactive/ElementCollection.php @@ -8,7 +8,6 @@ namespace Ibexa\Behat\Browser\Element\Debug\Interactive; -use EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait; use Ibexa\Behat\Browser\Assert\CollectionAssertInterface; use Ibexa\Behat\Browser\Assert\Debug\Interactive\CollectionAssert as InteractiveElementCollectionAssert; use Ibexa\Behat\Browser\Element\Criterion\CriterionInterface; @@ -16,6 +15,7 @@ use Ibexa\Behat\Browser\Element\ElementInterface; use Ibexa\Behat\Browser\Element\Mapper\MapperInterface; use Ibexa\Behat\Browser\Exception\ElementNotFoundException; +use Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; use PHPUnit\Framework\ExpectationFailedException; use Traversable; diff --git a/src/lib/Browser/Element/Debug/Interactive/RootElement.php b/src/lib/Browser/Element/Debug/Interactive/RootElement.php index 68c1b9a2..30dd2aab 100644 --- a/src/lib/Browser/Element/Debug/Interactive/RootElement.php +++ b/src/lib/Browser/Element/Debug/Interactive/RootElement.php @@ -9,8 +9,8 @@ namespace Ibexa\Behat\Browser\Element\Debug\Interactive; use Exception; -use EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait; use Ibexa\Behat\Browser\Element\RootElementInterface; +use Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; final class RootElement extends BaseElement implements RootElementInterface { diff --git a/src/lib/Browser/Element/ElementCollection.php b/src/lib/Browser/Element/ElementCollection.php index f03db6c2..42c0e097 100644 --- a/src/lib/Browser/Element/ElementCollection.php +++ b/src/lib/Browser/Element/ElementCollection.php @@ -21,6 +21,7 @@ class ElementCollection implements ElementCollectionInterface { /** @var ElementInterface[]|\Traversable */ private $elements; + /** * @var \Ibexa\Behat\Browser\Locator\LocatorInterface */ diff --git a/src/lib/Browser/Element/Mapper/ElementAttributeMapper.php b/src/lib/Browser/Element/Mapper/ElementAttributeMapper.php new file mode 100644 index 00000000..c3d94c3d --- /dev/null +++ b/src/lib/Browser/Element/Mapper/ElementAttributeMapper.php @@ -0,0 +1,26 @@ +attribute = $attribute; + } + + public function map(ElementInterface $element): string + { + return $element->getAttribute($this->attribute); + } +} diff --git a/src/lib/Browser/Element/RootElement.php b/src/lib/Browser/Element/RootElement.php index 1a0ec0c7..d4201fd7 100644 --- a/src/lib/Browser/Element/RootElement.php +++ b/src/lib/Browser/Element/RootElement.php @@ -31,7 +31,7 @@ public function dragAndDrop(string $from, string $hover, string $to): void throw new RuntimeException('drag-mock library has to be added to the page in order to use this method. Refer to README in BehatBundle for more information.'); } - $movingScript = sprintf('dragMock.dragStart(%s).dragOver(%s).delay(100).drop(%s);', $from, $hover, $to); + $movingScript = sprintf('{ const dragMockTmp = dragMock.dragStart(%s).delay(50).dragOver(%s).delay(50); setTimeout(() => dragMockTmp.drop(%s), 100); }', $from, $hover, $to); $this->session->getDriver()->executeScript($movingScript); } diff --git a/src/lib/Browser/FileUpload/FileUploadHelper.php b/src/lib/Browser/FileUpload/FileUploadHelper.php index 56abb792..de5ec188 100644 --- a/src/lib/Browser/FileUpload/FileUploadHelper.php +++ b/src/lib/Browser/FileUpload/FileUploadHelper.php @@ -8,6 +8,7 @@ namespace Ibexa\Behat\Browser\FileUpload; +use Behat\Mink\Driver\Selenium2Driver; use Behat\Mink\Session; use FriendsOfBehat\SymfonyExtension\Mink\MinkParameters; @@ -15,6 +16,7 @@ class FileUploadHelper { /** @var \Behat\Mink\Session */ private $session; + /** @var \FriendsOfBehat\SymfonyExtension\Mink\MinkParameters */ private $minkParameters; @@ -26,14 +28,19 @@ public function __construct(Session $session, MinkParameters $minkParameters) public function getRemoteFileUploadPath($filename) { - if (!preg_match('#[\w\\\/\.]*\.zip$#', $filename)) { - throw new \InvalidArgumentException('Zip archive required to upload to remote browser machine.'); - } - $localFile = sprintf('%s%s', $this->minkParameters['files_path'], $filename); + $driver = $this->session->getDriver(); + + if ($driver instanceof Selenium2Driver) { + if (!preg_match('#[\w\\\/\.]*\.zip$#', $filename)) { + throw new \InvalidArgumentException('Zip archive required to upload to remote browser machine.'); + } + + return $driver->getWebDriverSession()->file([ + 'file' => base64_encode(file_get_contents($localFile)), + ]); + } - return $this->session->getDriver()->getWebDriverSession()->file([ - 'file' => base64_encode(file_get_contents($localFile)), - ]); + return $localFile; } } diff --git a/src/lib/Browser/Filter/BrowserLogFilter.php b/src/lib/Browser/Filter/BrowserLogFilter.php index ec7af916..201b6e05 100644 --- a/src/lib/Browser/Filter/BrowserLogFilter.php +++ b/src/lib/Browser/Filter/BrowserLogFilter.php @@ -11,7 +11,7 @@ class BrowserLogFilter { private $excludedPatterns = [ - '@.*/api/ezp/v2/bookmark/.* - Failed to load resource: the server responded with a status of 404 \(Not Found\)@', + '@.*/api/ibexa/v2/bookmark/.* - Failed to load resource: the server responded with a status of 404 \(Not Found\)@', '@.*/bundles/netgentags/admin/jstree/js/jstree.min.js 5 document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.@', '@.*/admin/version-draft/has-no-conflict/.* - Failed to load resource: the server responded with a status of 409 \(Conflict\)@', '@webpack:///./vendor/ezsystems/ezplatform-admin-ui/src/bundle/Resources/public/js/scripts/fieldType/ezobjectrelationlist.js\? 91:12 "EzObjectRelation fieldtype is deprecated. Please, use EzObjectRelationList fieldtype instead."@', diff --git a/src/lib/Browser/Page/LoginPage.php b/src/lib/Browser/Page/LoginPage.php index 6049a827..6ba1713f 100644 --- a/src/lib/Browser/Page/LoginPage.php +++ b/src/lib/Browser/Page/LoginPage.php @@ -29,6 +29,7 @@ public function loginSuccessfully($username, $password): void $this->getHTMLPage()->findAll($this->getLocator('button')) ->filterBy(new LogicalOrCriterion([ new ElementTextCriterion('Login'), + new ElementTextCriterion('Log in'), new ElementTextCriterion('Sign in'), ])) ->single() diff --git a/src/lib/Browser/Routing/Router.php b/src/lib/Browser/Routing/Router.php index 4894d531..e0b12e88 100644 --- a/src/lib/Browser/Routing/Router.php +++ b/src/lib/Browser/Routing/Router.php @@ -8,13 +8,13 @@ namespace Ibexa\Behat\Browser\Routing; -use eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest; -use eZ\Publish\Core\MVC\Symfony\SiteAccess\Router as CoreRouter; use FriendsOfBehat\SymfonyExtension\Mink\MinkParameters; +use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; +use Ibexa\Core\MVC\Symfony\SiteAccess\Router as CoreRouter; final class Router { - /** @var \eZ\Publish\Core\MVC\Symfony\SiteAccess\Router */ + /** @var \Ibexa\Core\MVC\Symfony\SiteAccess\Router */ private $router; /** @var \FriendsOfBehat\SymfonyExtension\Mink\MinkParameters */ diff --git a/src/lib/Core/Behat/ArgumentParser.php b/src/lib/Core/Behat/ArgumentParser.php index 11f778d9..31cd92a1 100644 --- a/src/lib/Core/Behat/ArgumentParser.php +++ b/src/lib/Core/Behat/ArgumentParser.php @@ -6,10 +6,10 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Behat; +namespace Ibexa\Behat\Core\Behat; use Behat\Gherkin\Node\TableNode; -use EzSystems\Behat\API\Facade\RoleFacade; +use Ibexa\Behat\API\Facade\RoleFacade; use Ibexa\Behat\Browser\Environment\ParameterProviderInterface; class ArgumentParser @@ -35,9 +35,17 @@ public function __construct(RoleFacade $roleFacade, ParameterProviderInterface $ */ public function parseUrl(string $url) { - $url = str_replace([' ', '@', ',', ':', $this->parameterProvider->getParameter('root_content_name'), 'root'], ['-', '-', '', '-', '', ''], $url); + $url = str_replace([' ', '@', ',', ':', $this->parameterProvider->getParameter('root_content_name')], ['-', '-', '', '-', ''], $url); - return 0 === strpos($url, '/') ? $url : sprintf('/%s', $url); + if (strpos($url, '/') === 0) { + $url = substr($url, 1, strlen($url) - 1); + } + + if (strpos($url, 'root') === 0) { + $url = str_replace('root', '', $url); + } + + return strpos($url, '/') === 0 ? $url : sprintf('/%s', $url); } public function parseLimitations(TableNode $limitations) @@ -68,3 +76,5 @@ public function replaceRootKeyword(string $path): string return str_replace(self::ROOT_KEYWORD, $this->parameterProvider->getParameter('root_content_name'), $path); } } + +class_alias(ArgumentParser::class, 'EzSystems\Behat\Core\Behat\ArgumentParser'); diff --git a/src/lib/Core/Behat/TableNodeExtension.php b/src/lib/Core/Behat/TableNodeExtension.php index 49b88882..eba186eb 100644 --- a/src/lib/Core/Behat/TableNodeExtension.php +++ b/src/lib/Core/Behat/TableNodeExtension.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Behat; +namespace Ibexa\Behat\Core\Behat; use Behat\Gherkin\Node\TableNode; @@ -62,3 +62,5 @@ public static function removeColumn(TableNode $table, string $columnName): Table return new self($newTable); } } + +class_alias(TableNodeExtension::class, 'EzSystems\Behat\Core\Behat\TableNodeExtension'); diff --git a/src/lib/Core/Configuration/ConfigurationEditor.php b/src/lib/Core/Configuration/ConfigurationEditor.php index c48f0a9d..f2e91f70 100644 --- a/src/lib/Core/Configuration/ConfigurationEditor.php +++ b/src/lib/Core/Configuration/ConfigurationEditor.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Configuration; +namespace Ibexa\Behat\Core\Configuration; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\Yaml\Yaml; @@ -112,4 +112,18 @@ private function getNewValue($currentValue, $value, bool $appendToExisting) return array_merge($currentValue, $value); } + + public function copyKey($config, string $keyName, string $newKeyName) + { + $propertyAccessor = PropertyAccess::createPropertyAccessor(); + + $key = $this->parseKey($keyName); + $newKey = $this->parseKey($newKeyName); + $currentValue = $propertyAccessor->getValue($config, $key); + $propertyAccessor->setValue($config, $newKey, $currentValue); + + return $config; + } } + +class_alias(ConfigurationEditor::class, 'EzSystems\Behat\Core\Configuration\ConfigurationEditor'); diff --git a/src/lib/Core/Configuration/ConfigurationEditorInterface.php b/src/lib/Core/Configuration/ConfigurationEditorInterface.php index 9d74d318..c2b2d04c 100644 --- a/src/lib/Core/Configuration/ConfigurationEditorInterface.php +++ b/src/lib/Core/Configuration/ConfigurationEditorInterface.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Configuration; +namespace Ibexa\Behat\Core\Configuration; interface ConfigurationEditorInterface { @@ -44,4 +44,8 @@ public function getConfigFromFile(string $filePath); * @param $config */ public function saveConfigToFile($filePath, $config): void; + + public function copyKey($config, string $keyName, string $newKeyName); } + +class_alias(ConfigurationEditorInterface::class, 'EzSystems\Behat\Core\Configuration\ConfigurationEditorInterface'); diff --git a/src/lib/Core/Configuration/LocationAwareConfigurationEditor.php b/src/lib/Core/Configuration/LocationAwareConfigurationEditor.php index 26549cec..bf5c6a03 100644 --- a/src/lib/Core/Configuration/LocationAwareConfigurationEditor.php +++ b/src/lib/Core/Configuration/LocationAwareConfigurationEditor.php @@ -6,16 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Configuration; +namespace Ibexa\Behat\Core\Configuration; -use EzSystems\Behat\API\Facade\ContentFacade; +use Ibexa\Behat\API\Facade\ContentFacade; class LocationAwareConfigurationEditor implements ConfigurationEditorInterface { - /** @var \EzSystems\Behat\Core\Configuration\ConfigurationEditorInterface */ + /** @var \Ibexa\Behat\Core\Configuration\ConfigurationEditorInterface */ private $innerConfigurationEditor; - /** @var \EzSystems\Behat\API\Facade\ContentFacade */ + /** @var \Ibexa\Behat\API\Facade\ContentFacade */ private $contentFacade; public function __construct(ConfigurationEditorInterface $innerConfigurationEditor, ContentFacade $contentFacade) @@ -75,4 +75,13 @@ private function replaceSingleValue(&$value): void $value = $this->contentFacade->getLocationByLocationURL($matches[1])->id; } } + + public function copyKey($config, string $keyName, string $newKeyName) + { + $config = $this->innerConfigurationEditor->copyKey($config, $keyName, $newKeyName); + + return $this->resolveLocationReference($config); + } } + +class_alias(LocationAwareConfigurationEditor::class, 'EzSystems\Behat\Core\Configuration\LocationAwareConfigurationEditor'); diff --git a/src/lib/Core/Context/ConfigurationContext.php b/src/lib/Core/Context/ConfigurationContext.php index a70d6502..71ad5491 100644 --- a/src/lib/Core/Context/ConfigurationContext.php +++ b/src/lib/Core/Context/ConfigurationContext.php @@ -6,31 +6,33 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Context; +namespace Ibexa\Behat\Core\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use Exception; -use EzSystems\Behat\Core\Configuration\ConfigurationEditorInterface; +use Ibexa\Behat\Core\Configuration\ConfigurationEditorInterface; use Symfony\Component\Yaml\Yaml; class ConfigurationContext implements Context { - private const SITEACCESS_KEY_FORMAT = 'ezplatform.system.%s.%s'; - private const SITEACCESS_MATCHER_KEY = 'ezplatform.siteaccess.match'; - private $ezplatformConfigFilePath; - private $configFilePath; + private const SITEACCESS_KEY_FORMAT = 'ibexa.system.%s.%s'; + private const SITEACCESS_MATCHER_KEY = 'ibexa.siteaccess.match'; + + private $mainProjectConfigFilePath; + private $projectDir; + /** - * @var \EzSystems\Behat\Core\Configuration\ConfigurationEditorInterface + * @var \Ibexa\Behat\Core\Configuration\ConfigurationEditorInterface */ private $configurationEditor; public function __construct(string $projectDir, ConfigurationEditorInterface $configurationEditor) { $this->projectDir = $projectDir; - $this->ezplatformConfigFilePath = sprintf('%s/config/packages/ezplatform.yaml', $projectDir); + $this->mainProjectConfigFilePath = sprintf('%s/config/packages/ibexa.yaml', $projectDir); $this->configurationEditor = $configurationEditor; } @@ -42,10 +44,10 @@ public function __construct(string $projectDir, ConfigurationEditorInterface $co */ public function iAddSiteaccessWithSettings($siteaccessName, $siteaccessGroup, TableNode $settings) { - $config = $this->configurationEditor->getConfigFromFile($this->ezplatformConfigFilePath); + $config = $this->configurationEditor->getConfigFromFile($this->mainProjectConfigFilePath); - $config = $this->configurationEditor->append($config, 'ezplatform.siteaccess.list', $siteaccessName); - $config = $this->configurationEditor->append($config, sprintf('ezplatform.siteaccess.groups.%s', $siteaccessGroup), $siteaccessName); + $config = $this->configurationEditor->append($config, 'ibexa.siteaccess.list', $siteaccessName); + $config = $this->configurationEditor->append($config, sprintf('ibexa.siteaccess.groups.%s', $siteaccessGroup), $siteaccessName); foreach ($settings->getHash() as $setting) { $key = $setting['key']; @@ -53,7 +55,7 @@ public function iAddSiteaccessWithSettings($siteaccessName, $siteaccessGroup, Ta $config = $this->configurationEditor->set($config, sprintf(self::SITEACCESS_KEY_FORMAT, $siteaccessName, $key), $value); } - $this->configurationEditor->saveConfigToFile($this->ezplatformConfigFilePath, $config); + $this->configurationEditor->saveConfigToFile($this->mainProjectConfigFilePath, $config); } /** @@ -66,7 +68,7 @@ public function iAppendOrSetConfigurationToSiteaccess(string $mode, $siteaccessN { $appendToExisting = $this->shouldAppendValue($mode); - $configFilePath = $configFilePath ? sprintf('%s/%s', $this->projectDir, $configFilePath) : $this->ezplatformConfigFilePath; + $configFilePath = $configFilePath ? sprintf('%s/%s', $this->projectDir, $configFilePath) : $this->mainProjectConfigFilePath; $config = $this->configurationEditor->getConfigFromFile($configFilePath); @@ -94,7 +96,7 @@ public function iModifyConfigurationUnderKey(string $mode, $parentNode, PyString { $appendToExisting = $this->shouldAppendValue($mode); - $configFilePath = $configFilePath ? sprintf('%s/%s', $this->projectDir, $configFilePath) : $this->ezplatformConfigFilePath; + $configFilePath = $configFilePath ? sprintf('%s/%s', $this->projectDir, $configFilePath) : $this->mainProjectConfigFilePath; $config = $this->configurationEditor->getConfigFromFile($configFilePath); $parsedConfig = $this->parseConfig($configFragment); @@ -153,4 +155,18 @@ private function shouldAppendValue(string $value): bool return 'append' === $value; } + + /** + * @Given I copy the configuration from :keyName to :newKeyName + * @Given I copy the configuration from :keyName to :newKeyName in :configFilePath + */ + public function iCopyTheConfigurationFromTo(string $keyName, string $newKeyName, string $configFilePath = null) + { + $configFilePath = $configFilePath ? sprintf('%s/%s', $this->projectDir, $configFilePath) : $this->mainProjectConfigFilePath; + $config = $this->configurationEditor->getConfigFromFile($configFilePath); + $config = $this->configurationEditor->copyKey($config, $keyName, $newKeyName); + $this->configurationEditor->saveConfigToFile($configFilePath, $config); + } } + +class_alias(ConfigurationContext::class, 'EzSystems\Behat\Core\Context\ConfigurationContext'); diff --git a/src/lib/Core/Context/FileContext.php b/src/lib/Core/Context/FileContext.php index 443e8ba3..7a332be0 100644 --- a/src/lib/Core/Context/FileContext.php +++ b/src/lib/Core/Context/FileContext.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Context; +namespace Ibexa\Behat\Core\Context; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\PyStringNode; @@ -15,7 +15,8 @@ class FileContext implements Context { - private const SOURCE_FILE_DIRECTORY = 'vendor/ezsystems/behatbundle/src/lib/Data'; + private const SOURCE_FILE_DIRECTORY = 'vendor/ibexa/behat/src/lib/Data'; + /** @var string */ private $projectDirectory; @@ -82,3 +83,5 @@ private function createDirectoryStructure($destinationPath): void } } } + +class_alias(FileContext::class, 'EzSystems\Behat\Core\Context\FileContext'); diff --git a/src/lib/Core/Context/TimeContext.php b/src/lib/Core/Context/TimeContext.php index de7776ce..1a7f1829 100644 --- a/src/lib/Core/Context/TimeContext.php +++ b/src/lib/Core/Context/TimeContext.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Context; +namespace Ibexa\Behat\Core\Context; use Behat\Behat\Context\Context; use PHPUnit\Framework\Assert; @@ -62,3 +62,5 @@ public function actionTookLongerThan(string $maxDuration): void Assert::assertGreaterThan($maxDuration, $actualDuration); } } + +class_alias(TimeContext::class, 'EzSystems\Behat\Core\Context\TimeContext'); diff --git a/src/lib/Core/Debug/Command/GoBackCommand.php b/src/lib/Core/Debug/Command/GoBackCommand.php index 12e09150..5a6c1c82 100644 --- a/src/lib/Core/Debug/Command/GoBackCommand.php +++ b/src/lib/Core/Debug/Command/GoBackCommand.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Command; +namespace Ibexa\Behat\Core\Debug\Command; use Behat\Mink\Session; use Psy\Command\Command; @@ -42,3 +42,5 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } } + +class_alias(GoBackCommand::class, 'EzSystems\Behat\Core\Debug\Command\GoBackCommand'); diff --git a/src/lib/Core/Debug/Command/RefreshPageCommand.php b/src/lib/Core/Debug/Command/RefreshPageCommand.php index e04a99a8..51aae084 100644 --- a/src/lib/Core/Debug/Command/RefreshPageCommand.php +++ b/src/lib/Core/Debug/Command/RefreshPageCommand.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Command; +namespace Ibexa\Behat\Core\Debug\Command; use Behat\Mink\Session; use Psy\Command\Command; @@ -42,3 +42,5 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } } + +class_alias(RefreshPageCommand::class, 'EzSystems\Behat\Core\Debug\Command\RefreshPageCommand'); diff --git a/src/lib/Core/Debug/Command/ShowHTMLCommand.php b/src/lib/Core/Debug/Command/ShowHTMLCommand.php index 1516596d..d64529ec 100644 --- a/src/lib/Core/Debug/Command/ShowHTMLCommand.php +++ b/src/lib/Core/Debug/Command/ShowHTMLCommand.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Command; +namespace Ibexa\Behat\Core\Debug\Command; use Behat\Mink\Session; use Psy\Command\Command; @@ -40,3 +40,5 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } } + +class_alias(ShowHTMLCommand::class, 'EzSystems\Behat\Core\Debug\Command\ShowHTMLCommand'); diff --git a/src/lib/Core/Debug/Command/ShowURLCommand.php b/src/lib/Core/Debug/Command/ShowURLCommand.php index 9858e5a4..89fbcace 100644 --- a/src/lib/Core/Debug/Command/ShowURLCommand.php +++ b/src/lib/Core/Debug/Command/ShowURLCommand.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Command; +namespace Ibexa\Behat\Core\Debug\Command; use Behat\Mink\Session; use Psy\Command\Command; @@ -40,3 +40,5 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } } + +class_alias(ShowURLCommand::class, 'EzSystems\Behat\Core\Debug\Command\ShowURLCommand'); diff --git a/src/lib/Core/Debug/Command/TakeScreenshotCommand.php b/src/lib/Core/Debug/Command/TakeScreenshotCommand.php index e403452e..6e022844 100644 --- a/src/lib/Core/Debug/Command/TakeScreenshotCommand.php +++ b/src/lib/Core/Debug/Command/TakeScreenshotCommand.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Command; +namespace Ibexa\Behat\Core\Debug\Command; use Behat\Mink\Session; use Cloudinary; @@ -62,3 +62,5 @@ protected function execute(InputInterface $input, OutputInterface $output) } } } + +class_alias(TakeScreenshotCommand::class, 'EzSystems\Behat\Core\Debug\Command\TakeScreenshotCommand'); diff --git a/src/lib/Core/Debug/InteractiveDebuggerTrait.php b/src/lib/Core/Debug/InteractiveDebuggerTrait.php index 81c0d4f1..d9ac8aa5 100644 --- a/src/lib/Core/Debug/InteractiveDebuggerTrait.php +++ b/src/lib/Core/Debug/InteractiveDebuggerTrait.php @@ -6,16 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug; +namespace Ibexa\Behat\Core\Debug; use Exception; -use EzSystems\Behat\Core\Debug\Command\GoBackCommand; -use EzSystems\Behat\Core\Debug\Command\RefreshPageCommand; -use EzSystems\Behat\Core\Debug\Command\ShowHTMLCommand; -use EzSystems\Behat\Core\Debug\Command\ShowURLCommand; -use EzSystems\Behat\Core\Debug\Command\TakeScreenshotCommand; -use EzSystems\Behat\Core\Debug\Shell\Shell; use Ibexa\Behat\Browser\Component\Component; +use Ibexa\Behat\Core\Debug\Command\GoBackCommand; +use Ibexa\Behat\Core\Debug\Command\RefreshPageCommand; +use Ibexa\Behat\Core\Debug\Command\ShowHTMLCommand; +use Ibexa\Behat\Core\Debug\Command\ShowURLCommand; +use Ibexa\Behat\Core\Debug\Command\TakeScreenshotCommand; +use Ibexa\Behat\Core\Debug\Shell\Shell; use RuntimeException; trait InteractiveDebuggerTrait @@ -131,3 +131,5 @@ private function addCommands(Shell $sh, Component $component): void ]); } } + +class_alias(InteractiveDebuggerTrait::class, 'EzSystems\Behat\Core\Debug\InteractiveDebuggerTrait'); diff --git a/src/lib/Core/Debug/Matcher/ObjectFunctionCallChainMatcher.php b/src/lib/Core/Debug/Matcher/ObjectFunctionCallChainMatcher.php index 5d8eaa6e..1f5f1433 100644 --- a/src/lib/Core/Debug/Matcher/ObjectFunctionCallChainMatcher.php +++ b/src/lib/Core/Debug/Matcher/ObjectFunctionCallChainMatcher.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Matcher; +namespace Ibexa\Behat\Core\Debug\Matcher; use Psy\TabCompletion\Matcher\AbstractMatcher; use Psy\TabCompletion\Matcher\ObjectMethodsMatcher; @@ -117,3 +117,5 @@ protected function getObjectClass($tokenGroup): string return get_class($object); } } + +class_alias(ObjectFunctionCallChainMatcher::class, 'EzSystems\Behat\Core\Debug\Matcher\ObjectFunctionCallChainMatcher'); diff --git a/src/lib/Core/Debug/Matcher/ThisObjectMethodsMatcher.php b/src/lib/Core/Debug/Matcher/ThisObjectMethodsMatcher.php index 7a86ebee..5d59d77e 100644 --- a/src/lib/Core/Debug/Matcher/ThisObjectMethodsMatcher.php +++ b/src/lib/Core/Debug/Matcher/ThisObjectMethodsMatcher.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Matcher; +namespace Ibexa\Behat\Core\Debug\Matcher; use InvalidArgumentException; use Psy\TabCompletion\Matcher\AbstractMatcher; @@ -54,3 +54,5 @@ static function ($methodName) use ($input) { )); } } + +class_alias(ThisObjectMethodsMatcher::class, 'EzSystems\Behat\Core\Debug\Matcher\ThisObjectMethodsMatcher'); diff --git a/src/lib/Core/Debug/Shell/Shell.php b/src/lib/Core/Debug/Shell/Shell.php index 305f1edc..d0dd08f2 100644 --- a/src/lib/Core/Debug/Shell/Shell.php +++ b/src/lib/Core/Debug/Shell/Shell.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Debug\Shell; +namespace Ibexa\Behat\Core\Debug\Shell; use Exception; -use EzSystems\Behat\Core\Debug\Matcher\ObjectFunctionCallChainMatcher; -use EzSystems\Behat\Core\Debug\Matcher\ThisObjectMethodsMatcher; +use Ibexa\Behat\Core\Debug\Matcher\ObjectFunctionCallChainMatcher; +use Ibexa\Behat\Core\Debug\Matcher\ThisObjectMethodsMatcher; use Psy\Shell as BaseShell; use Psy\TabCompletion\Matcher\AbstractMatcher; use Psy\TabCompletion\Matcher\FunctionsMatcher; @@ -74,3 +74,5 @@ public function displayExceptionMessage(Exception $e) $this->writeMessage('The error message is: ' . $e->getMessage()); } } + +class_alias(Shell::class, 'EzSystems\Behat\Core\Debug\Shell\Shell'); diff --git a/src/lib/Core/Log/Failure/KnownIssues/TextBlockHeaderSelection.php b/src/lib/Core/Log/Failure/KnownIssues/TextBlockHeaderSelection.php index a87ced72..54b2a0d4 100644 --- a/src/lib/Core/Log/Failure/KnownIssues/TextBlockHeaderSelection.php +++ b/src/lib/Core/Log/Failure/KnownIssues/TextBlockHeaderSelection.php @@ -14,7 +14,7 @@ class TextBlockHeaderSelection implements KnownIssueInterface { public function matches(TestFailureData $testFailureData): bool { - return $testFailureData->exceptionMessageContainsFragment("Could not find element named: 'Paragraph'. Found names") + return $testFailureData->exceptionMessageContainsFragment("Could not find element named: 'Paragraph'") && $testFailureData->exceptionStackTraceContainsFragment('RichText->changeStyle()'); } diff --git a/src/lib/Core/Log/LogFileReader.php b/src/lib/Core/Log/LogFileReader.php index 7dcf01dc..42cb3222 100644 --- a/src/lib/Core/Log/LogFileReader.php +++ b/src/lib/Core/Log/LogFileReader.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Log; +namespace Ibexa\Behat\Core\Log; class LogFileReader { @@ -40,3 +40,5 @@ public function getLastLines($filePath, $numberOfLines): array return $logEntries; } } + +class_alias(LogFileReader::class, 'EzSystems\Behat\Core\Log\LogFileReader'); diff --git a/src/lib/Core/Log/TestLogProvider.php b/src/lib/Core/Log/TestLogProvider.php index 26463dbc..4f845849 100644 --- a/src/lib/Core/Log/TestLogProvider.php +++ b/src/lib/Core/Log/TestLogProvider.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Core\Log; +namespace Ibexa\Behat\Core\Log; use Behat\Mink\Driver\Selenium2Driver; use Behat\Mink\Session; @@ -104,3 +104,5 @@ private function cacheLogs(array $logs): void self::$LOGS = $logs; } } + +class_alias(TestLogProvider::class, 'EzSystems\Behat\Core\Log\TestLogProvider'); diff --git a/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_block.en.yaml b/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_block.en.yaml index dc78a59a..e6a95f78 100644 --- a/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_block.en.yaml +++ b/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_block.en.yaml @@ -1,2 +1,2 @@ -ezrichtext.custom_styles.highlighted_block_test.label: Highlighted block \ No newline at end of file +ibexa_fieldtype_richtext.custom_styles.highlighted_block_test.label: Highlighted block diff --git a/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_word.en.yaml b/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_word.en.yaml index 4dcf10ec..ef8856ac 100644 --- a/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_word.en.yaml +++ b/src/lib/Data/Files/Richtext/CustomStyle/translations/highlighted_word.en.yaml @@ -1,2 +1,2 @@ -ezrichtext.custom_styles.highlighted_word_test.label: Highlighted word \ No newline at end of file +ibexa_fieldtype_richtext.custom_styles.highlighted_word_test.label: Highlighted word diff --git a/src/lib/Data/Files/Richtext/CustomTag/translations/ezfacebook.en.yaml b/src/lib/Data/Files/Richtext/CustomTag/translations/ezfacebook.en.yaml index 976eff3c..2a2b7045 100644 --- a/src/lib/Data/Files/Richtext/CustomTag/translations/ezfacebook.en.yaml +++ b/src/lib/Data/Files/Richtext/CustomTag/translations/ezfacebook.en.yaml @@ -1,5 +1,5 @@ -ezrichtext.custom_tags.ezfacebook_test.label: Facebook -ezrichtext.custom_tags.ezfacebook_test.description: '' -ezrichtext.custom_tags.ezfacebook_test.attributes.post_url.label: 'Post URL' -ezrichtext.custom_tags.ezfacebook_test.attributes.width.label: Width \ No newline at end of file +ibexa_fieldtype_richtext.custom_tags.ezfacebook_test.label: Facebook +ibexa_fieldtype_richtext.custom_tags.ezfacebook_test.description: '' +ibexa_fieldtype_richtext.custom_tags.ezfacebook_test.attributes.post_url.label: 'Post URL' +ibexa_fieldtype_richtext.custom_tags.ezfacebook_test.attributes.width.label: Width diff --git a/src/lib/Data/Files/Richtext/CustomTag/translations/eztwitter.en.yaml b/src/lib/Data/Files/Richtext/CustomTag/translations/eztwitter.en.yaml index 177046e3..6aa7f09f 100644 --- a/src/lib/Data/Files/Richtext/CustomTag/translations/eztwitter.en.yaml +++ b/src/lib/Data/Files/Richtext/CustomTag/translations/eztwitter.en.yaml @@ -1,11 +1,11 @@ -ezrichtext.custom_tags.eztwitter_test.label: Twitter -ezrichtext.custom_tags.eztwitter_test.description: '' -ezrichtext.custom_tags.eztwitter_test.attributes.cards.label: Cards -ezrichtext.custom_tags.eztwitter_test.attributes.conversation.label: Conversation -ezrichtext.custom_tags.eztwitter_test.attributes.dnt.label: DNT -ezrichtext.custom_tags.eztwitter_test.attributes.lang.label: Lang -ezrichtext.custom_tags.eztwitter_test.attributes.link_color.label: 'Link color' -ezrichtext.custom_tags.eztwitter_test.attributes.theme.label: Theme -ezrichtext.custom_tags.eztwitter_test.attributes.tweet_url.label: 'Tweet url' -ezrichtext.custom_tags.eztwitter_test.attributes.width.label: Width \ No newline at end of file +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.label: Twitter +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.description: '' +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.cards.label: Cards +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.conversation.label: Conversation +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.dnt.label: DNT +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.lang.label: Lang +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.link_color.label: 'Link color' +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.theme.label: Theme +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.tweet_url.label: 'Tweet url' +ibexa_fieldtype_richtext.custom_tags.eztwitter_test.attributes.width.label: Width diff --git a/src/lib/Data/Files/Richtext/CustomTag/translations/ezyoutube.en.yaml b/src/lib/Data/Files/Richtext/CustomTag/translations/ezyoutube.en.yaml index 28d59e59..34ebb8e0 100644 --- a/src/lib/Data/Files/Richtext/CustomTag/translations/ezyoutube.en.yaml +++ b/src/lib/Data/Files/Richtext/CustomTag/translations/ezyoutube.en.yaml @@ -1,8 +1,8 @@ -ezrichtext.custom_tags.ezyoutube_test.label: Youtube -ezrichtext.custom_tags.ezyoutube_test.description: '' -ezrichtext.custom_tags.ezyoutube_test.attributes.autoplay.label: Autoplay -ezrichtext.custom_tags.ezyoutube_test.attributes.height.label: Height -ezrichtext.custom_tags.ezyoutube_test.attributes.title.label: Title -ezrichtext.custom_tags.ezyoutube_test.attributes.video_url.label: Video url -ezrichtext.custom_tags.ezyoutube_test.attributes.width.label: Width -ezrichtext.custom_tags.ezyoutube_test.attributes.align.label: Align \ No newline at end of file +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.label: Youtube +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.description: '' +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.attributes.autoplay.label: Autoplay +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.attributes.height.label: Height +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.attributes.title.label: Title +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.attributes.video_url.label: Video url +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.attributes.width.label: Width +ibexa_fieldtype_richtext.custom_tags.ezyoutube_test.attributes.align.label: Align diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout1.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout1.html.twig index ee2ee620..5228d316 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout1.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout1.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout10.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout10.html.twig index 7f248a3e..bae68b03 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout10.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout10.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout11.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout11.html.twig index 5e6ddc2d..80d95165 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout11.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout11.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout12.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout12.html.twig index 3ebc7948..8ebdc89a 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout12.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout12.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout13.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout13.html.twig index ec17ce7e..686d81f7 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout13.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout13.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout14.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout14.html.twig index 943c6354..f021e30e 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout14.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout14.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout15.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout15.html.twig index 3fac96fe..a71e48dd 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout15.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout15.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout16.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout16.html.twig index 35d3c37f..fc7d13d6 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout16.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout16.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout17.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout17.html.twig index bd3d3d9a..e5f5d7cf 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout17.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout17.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout18.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout18.html.twig index 432cd006..433f73e1 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout18.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout18.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout19.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout19.html.twig index 6d0e42b1..ec1e0ded 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout19.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout19.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout2.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout2.html.twig index 0d0e69ea..b717aabf 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout2.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout2.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout20.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout20.html.twig index 701d187e..5825c554 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout20.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout20.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout3.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout3.html.twig index d87e9f00..bcf6f917 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout3.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout3.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout4.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout4.html.twig index f823754f..d13d37dc 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout4.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout4.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout5.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout5.html.twig index 8d7b6e98..6f86bbff 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout5.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout5.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout6.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout6.html.twig index 4b89478e..0efeddbf 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout6.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout6.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout7.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout7.html.twig index 02faa192..baa1e094 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout7.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout7.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout8.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout8.html.twig index 58b41efd..be9e7953 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout8.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout8.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Data/Templates/SiteFactory/pagelayout9.html.twig b/src/lib/Data/Templates/SiteFactory/pagelayout9.html.twig index 190a5e8d..1f037e96 100644 --- a/src/lib/Data/Templates/SiteFactory/pagelayout9.html.twig +++ b/src/lib/Data/Templates/SiteFactory/pagelayout9.html.twig @@ -1,7 +1,7 @@ - + {% if content is defined and title is not defined %} {% set title = ez_content_name( content ) %} @@ -18,17 +18,17 @@
Item: -{{ ez_render(content) }} +{{ ibexa_render(content) }}
Item with ESI: -{{ ez_render(content, { method: "esi" }) }} +{{ ibexa_render(content, { method: "esi" }) }}
Site: -{{ ez_render(ezplatform.rootLocation)}} +{{ ibexa_render(ezplatform.rootLocation)}}
diff --git a/src/lib/Event/Events.php b/src/lib/Event/Events.php index ae07d88f..c8542941 100644 --- a/src/lib/Event/Events.php +++ b/src/lib/Event/Events.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Event; +namespace Ibexa\Behat\Event; class Events { @@ -30,3 +30,5 @@ class Events public const PUBLISH_LATER_TO_END = 'volume_testing.transition.publish_later_to_end'; } + +class_alias(Events::class, 'EzSystems\Behat\Event\Events'); diff --git a/src/lib/Event/InitialEvent.php b/src/lib/Event/InitialEvent.php index 5bcd0154..4abb6698 100644 --- a/src/lib/Event/InitialEvent.php +++ b/src/lib/Event/InitialEvent.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Event; +namespace Ibexa\Behat\Event; use Symfony\Contracts\EventDispatcher\Event; @@ -40,3 +40,5 @@ public function __construct(string $country, string $mainLanguage, array $editor $this->mainLanguage = $mainLanguage; } } + +class_alias(InitialEvent::class, 'EzSystems\Behat\Event\InitialEvent'); diff --git a/src/lib/Event/TransitionEvent.php b/src/lib/Event/TransitionEvent.php index aa63ac13..4b11c831 100644 --- a/src/lib/Event/TransitionEvent.php +++ b/src/lib/Event/TransitionEvent.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Event; +namespace Ibexa\Behat\Event; use Symfony\Contracts\EventDispatcher\Event; @@ -18,7 +18,7 @@ class TransitionEvent extends Event /** @var string */ public $contentTypeIdentifier; - /** @var \eZ\Publish\API\Repository\Values\Content\Content */ + /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content */ public $content; /** @var array */ @@ -42,3 +42,5 @@ public function __construct(array $editors, string $contentTypeIdentifier, strin $this->mainLanguage = $mainLanguage; } } + +class_alias(TransitionEvent::class, 'EzSystems\Behat\Event\TransitionEvent'); diff --git a/src/lib/QueryType/FoldersUnderMediaQueryType.php b/src/lib/QueryType/FoldersUnderMediaQueryType.php index 9cf0024f..f59f7c12 100644 --- a/src/lib/QueryType/FoldersUnderMediaQueryType.php +++ b/src/lib/QueryType/FoldersUnderMediaQueryType.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\QueryType; +namespace Ibexa\Behat\QueryType; -use eZ\Publish\API\Repository\Values\Content\Query; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion; -use eZ\Publish\Core\QueryType\QueryType; +use Ibexa\Contracts\Core\Repository\Values\Content\Query; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Core\QueryType\QueryType; class FoldersUnderMediaQueryType implements QueryType { @@ -35,3 +35,5 @@ public static function getName() return 'Folders under media'; } } + +class_alias(FoldersUnderMediaQueryType::class, 'EzSystems\Behat\QueryType\FoldersUnderMediaQueryType'); diff --git a/src/lib/Subscriber/AbstractProcessStage.php b/src/lib/Subscriber/AbstractProcessStage.php index a9ab12e9..3d3872f8 100644 --- a/src/lib/Subscriber/AbstractProcessStage.php +++ b/src/lib/Subscriber/AbstractProcessStage.php @@ -6,13 +6,13 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; +namespace Ibexa\Behat\Subscriber; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use eZ\Publish\API\Repository\Values\User\User; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\Event\TransitionEvent; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; +use Ibexa\Contracts\Core\Repository\Values\User\User; use PHPUnit\Framework\Assert; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; @@ -24,16 +24,16 @@ abstract class AbstractProcessStage /** @var \Psr\Log\LoggerInterface */ protected $logger; - /** @var \eZ\Publish\API\Repository\UserService */ + /** @var \Ibexa\Contracts\Core\Repository\UserService */ private $userService; - /** @var \eZ\Publish\API\Repository\PermissionResolver */ + /** @var \Ibexa\Contracts\Core\Repository\PermissionResolver */ private $permissionResolver; /** @var \Symfony\Component\EventDispatcher\EventDispatcher */ private $eventDispatcher; - /** @var \EzSystems\Behat\API\ContentData\RandomDataGenerator */ + /** @var \Ibexa\Behat\API\ContentData\RandomDataGenerator */ protected $randomDataGenerator; public function __construct( @@ -108,7 +108,7 @@ public function execute(Event $event): void try { $this->doExecute($event); } catch (\Exception $ex) { - $this->logger->log(LogLevel::ERROR, sprintf('Error occured during %s Stage: %s', get_class($this), $ex->getMessage())); + $this->logger->log(LogLevel::ERROR, sprintf('Error occured during %s Stage: %s', static::class, $ex->getMessage())); return; } @@ -117,3 +117,5 @@ public function execute(Event $event): void abstract protected function doExecute(TransitionEvent $event): void; } + +class_alias(AbstractProcessStage::class, 'EzSystems\Behat\Subscriber\AbstractProcessStage'); diff --git a/src/lib/Subscriber/CreateContentDraft.php b/src/lib/Subscriber/CreateContentDraft.php index f1f535b2..cdffd36f 100644 --- a/src/lib/Subscriber/CreateContentDraft.php +++ b/src/lib/Subscriber/CreateContentDraft.php @@ -6,14 +6,14 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; +namespace Ibexa\Behat\Subscriber; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\API\Facade\ContentFacade; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\TransitionEvent; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\API\Facade\ContentFacade; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Ibexa\Workflow\Behat\Facade\WorkflowFacade; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -21,7 +21,7 @@ class CreateContentDraft extends AbstractProcessStage implements EventSubscriberInterface { - /** @var \EzSystems\Behat\API\Facade\ContentFacade */ + /** @var \Ibexa\Behat\API\Facade\ContentFacade */ private $contentFacade; /** @var \Ibexa\Workflow\Behat\Facade\WorkflowFacade */ @@ -66,3 +66,5 @@ public function doExecute(TransitionEvent $event): void $this->workflowFacade->transition($event->content, $transitionName, $this->randomDataGenerator->getRandomTextLine()); } } + +class_alias(CreateContentDraft::class, 'EzSystems\Behat\Subscriber\CreateContentDraft'); diff --git a/src/lib/Subscriber/EditContent.php b/src/lib/Subscriber/EditContent.php index 4292339e..e0d4445f 100644 --- a/src/lib/Subscriber/EditContent.php +++ b/src/lib/Subscriber/EditContent.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; +namespace Ibexa\Behat\Subscriber; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use EzSystems\Behat\API\ContentData\ContentDataProvider; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\TransitionEvent; +use Ibexa\Behat\API\ContentData\ContentDataProvider; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Ibexa\Workflow\Behat\Facade\WorkflowFacade; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -22,10 +22,10 @@ class EditContent extends AbstractProcessStage implements EventSubscriberInterface { - /** @var \EzSystems\Behat\API\ContentData\ContentDataProvider */ + /** @var \Ibexa\Behat\API\ContentData\ContentDataProvider */ private $contentDataProvider; - /** @var \eZ\Publish\API\Repository\ContentService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentService */ private $contentService; /** @var \Ibexa\Workflow\Behat\Facade\WorkflowFacade */ @@ -76,3 +76,5 @@ protected function doExecute(TransitionEvent $event): void $this->workflowFacade->transition($event->content, $transitionName, $this->randomDataGenerator->getRandomTextLine()); } } + +class_alias(EditContent::class, 'EzSystems\Behat\Subscriber\EditContent'); diff --git a/src/lib/Subscriber/InitialStage.php b/src/lib/Subscriber/InitialStage.php index a0c83405..2743fdf1 100644 --- a/src/lib/Subscriber/InitialStage.php +++ b/src/lib/Subscriber/InitialStage.php @@ -6,22 +6,22 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; - -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\API\Facade\SearchFacade; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\InitialEvent; -use EzSystems\Behat\Event\TransitionEvent; +namespace Ibexa\Behat\Subscriber; + +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\API\Facade\SearchFacade; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\InitialEvent; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class InitialStage extends AbstractProcessStage implements EventSubscriberInterface { - /** @var \EzSystems\Behat\API\Facade\SearchFacade */ + /** @var \Ibexa\Behat\API\Facade\SearchFacade */ private $searchFacade; protected function getTransitions(): array @@ -86,3 +86,5 @@ protected function doExecute(TransitionEvent $event): void { } } + +class_alias(InitialStage::class, 'EzSystems\Behat\Subscriber\InitialStage'); diff --git a/src/lib/Subscriber/PublishDraft.php b/src/lib/Subscriber/PublishDraft.php index df775b5c..395cc52b 100644 --- a/src/lib/Subscriber/PublishDraft.php +++ b/src/lib/Subscriber/PublishDraft.php @@ -6,14 +6,14 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; +namespace Ibexa\Behat\Subscriber; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\TransitionEvent; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Ibexa\Workflow\Behat\Facade\WorkflowFacade; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -21,7 +21,7 @@ class PublishDraft extends AbstractProcessStage implements EventSubscriberInterface { - /** @var \eZ\Publish\API\Repository\ContentService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentService */ private $contentService; /** @var \Ibexa\Workflow\Behat\Facade\WorkflowFacade */ @@ -64,3 +64,5 @@ protected function doExecute(TransitionEvent $event): void $event->content = $this->contentService->publishVersion($event->content->versionInfo); } } + +class_alias(PublishDraft::class, 'EzSystems\Behat\Subscriber\PublishDraft'); diff --git a/src/lib/Subscriber/PublishInTheFuture.php b/src/lib/Subscriber/PublishInTheFuture.php index e18130cf..7a454c80 100644 --- a/src/lib/Subscriber/PublishInTheFuture.php +++ b/src/lib/Subscriber/PublishInTheFuture.php @@ -6,14 +6,14 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; +namespace Ibexa\Behat\Subscriber; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\TransitionEvent; -use EzSystems\DateBasedPublisher\API\Repository\DateBasedPublishServiceInterface; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; +use Ibexa\Contracts\Scheduler\Repository\DateBasedPublishServiceInterface; use Ibexa\Workflow\Behat\Facade\WorkflowFacade; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -21,7 +21,7 @@ class PublishInTheFuture extends AbstractProcessStage implements EventSubscriberInterface { - /** @var \EzSystems\DateBasedPublisher\API\Repository\DateBasedPublishServiceInterface */ + /** @var \Ibexa\Contracts\Scheduler\Repository\DateBasedPublishServiceInterface */ private $dateBasedPublisherService; /** @var \Ibexa\Workflow\Behat\Facade\WorkflowFacade */ @@ -63,3 +63,5 @@ public static function getSubscribedEvents() ]; } } + +class_alias(PublishInTheFuture::class, 'EzSystems\Behat\Subscriber\PublishInTheFuture'); diff --git a/src/lib/Subscriber/Review.php b/src/lib/Subscriber/Review.php index 2f212178..5c814532 100644 --- a/src/lib/Subscriber/Review.php +++ b/src/lib/Subscriber/Review.php @@ -6,15 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Subscriber; +namespace Ibexa\Behat\Subscriber; -use eZ\Publish\API\Repository\ContentService; -use eZ\Publish\API\Repository\PermissionResolver; -use eZ\Publish\API\Repository\UserService; -use EzSystems\Behat\API\ContentData\ContentDataProvider; -use EzSystems\Behat\API\ContentData\RandomDataGenerator; -use EzSystems\Behat\Event\Events; -use EzSystems\Behat\Event\TransitionEvent; +use Ibexa\Behat\API\ContentData\ContentDataProvider; +use Ibexa\Behat\API\ContentData\RandomDataGenerator; +use Ibexa\Behat\Event\Events; +use Ibexa\Behat\Event\TransitionEvent; +use Ibexa\Contracts\Core\Repository\ContentService; +use Ibexa\Contracts\Core\Repository\PermissionResolver; +use Ibexa\Contracts\Core\Repository\UserService; use Ibexa\Workflow\Behat\Facade\WorkflowFacade; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -22,10 +22,10 @@ class Review extends AbstractProcessStage implements EventSubscriberInterface { - /** @var \EzSystems\Behat\API\ContentData\ContentDataProvider */ + /** @var \Ibexa\Behat\API\ContentData\ContentDataProvider */ private $contentDataProvider; - /** @var \eZ\Publish\API\Repository\ContentService */ + /** @var \Ibexa\Contracts\Core\Repository\ContentService */ private $contentService; /** @var \Ibexa\Workflow\Behat\Facade\WorkflowFacade */ @@ -77,3 +77,5 @@ protected function doExecute(TransitionEvent $event): void $this->workflowFacade->transition($event->content, $transitionName, $this->randomDataGenerator->getRandomTextLine()); } } + +class_alias(Review::class, 'EzSystems\Behat\Subscriber\Review'); diff --git a/tests/Browser/Element/Assert/CollectionAssertTest.php b/tests/Browser/Element/Assert/CollectionAssertTest.php index 06d777a8..ac212300 100644 --- a/tests/Browser/Element/Assert/CollectionAssertTest.php +++ b/tests/Browser/Element/Assert/CollectionAssertTest.php @@ -6,12 +6,12 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Assert; +namespace Ibexa\Tests\Behat\Browser\Element\Assert; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Assert\CollectionAssert; use Ibexa\Behat\Browser\Element\ElementCollection; use Ibexa\Behat\Browser\Locator\XPathLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\ExpectationFailedException; class CollectionAssertTest extends BaseTestCase diff --git a/tests/Browser/Element/BaseTestCase.php b/tests/lib/Browser/Element/BaseTestCase.php similarity index 95% rename from tests/Browser/Element/BaseTestCase.php rename to tests/lib/Browser/Element/BaseTestCase.php index 5703ab82..28e7cc3c 100644 --- a/tests/Browser/Element/BaseTestCase.php +++ b/tests/lib/Browser/Element/BaseTestCase.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element; +namespace Ibexa\Tests\Behat\Browser\Element; use Behat\Mink\Element\NodeElement; use Ibexa\Behat\Browser\Element\ElementCollection; @@ -73,3 +73,5 @@ public function createCollection(LocatorInterface $locator, ...$elementTexts): E return new ElementCollection($locator, $elements); } } + +class_alias(BaseTestCase::class, 'EzSystems\Behat\Test\Browser\Element\BaseTestCase'); diff --git a/tests/Browser/Element/Condition/ElementExistsConditionTest.php b/tests/lib/Browser/Element/Condition/ElementExistsConditionTest.php similarity index 86% rename from tests/Browser/Element/Condition/ElementExistsConditionTest.php rename to tests/lib/Browser/Element/Condition/ElementExistsConditionTest.php index 5bd21ff7..a3136a72 100644 --- a/tests/Browser/Element/Condition/ElementExistsConditionTest.php +++ b/tests/lib/Browser/Element/Condition/ElementExistsConditionTest.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Condition; +namespace Ibexa\Tests\Behat\Browser\Element\Condition; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Condition\ElementExistsCondition; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementExistsConditionTest extends BaseTestCase @@ -43,3 +43,5 @@ public function testElementDoesNotExist(): void ); } } + +class_alias(ElementExistsConditionTest::class, 'EzSystems\Behat\Test\Browser\Element\Condition\ElementExistsConditionTest'); diff --git a/tests/lib/Browser/Element/Condition/ElementHasTextConditionTest.php b/tests/lib/Browser/Element/Condition/ElementHasTextConditionTest.php new file mode 100644 index 00000000..c0b80e53 --- /dev/null +++ b/tests/lib/Browser/Element/Condition/ElementHasTextConditionTest.php @@ -0,0 +1,49 @@ +createElementWithChildElement( + 'root', + $searchedElementLocator, + $this->createElement('DummyText') + ), + $searchedElementLocator, + 'DummyText' + ); + + Assert::assertTrue($condition->isMet()); + } + + public function testElemetDoesNotHaveText(): void + { + $searchedElementLocator = new CSSLocator('not-have-text-id', 'not-have-text-selector'); + $condition = new ElementHasTextCondition( + $this->createElementWithChildElement( + 'root', + new CSSLocator('dummy-id', 'dummy-selector'), + $this->createElement('DummyText') + ), + $searchedElementLocator, + 'Dummy1Text2' + ); + + Assert::assertFalse($condition->isMet()); + } +} diff --git a/tests/Browser/Element/Condition/ElementNotExistsConditionTest.php b/tests/lib/Browser/Element/Condition/ElementNotExistsConditionTest.php similarity index 80% rename from tests/Browser/Element/Condition/ElementNotExistsConditionTest.php rename to tests/lib/Browser/Element/Condition/ElementNotExistsConditionTest.php index fddce343..6f87e930 100644 --- a/tests/Browser/Element/Condition/ElementNotExistsConditionTest.php +++ b/tests/lib/Browser/Element/Condition/ElementNotExistsConditionTest.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Condition; +namespace Ibexa\Tests\Behat\Browser\Element\Condition; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Condition\ElementNotExistsCondition; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementNotExistsConditionTest extends BaseTestCase @@ -20,7 +20,9 @@ public function testElementDoesNotExist(): void $searchedElementLocator = new CSSLocator('not-exist-id', 'not-exist-selector'); $condition = new ElementNotExistsCondition( $this->createElementWithChildElement( - 'root', new CSSLocator('dummy-id', 'dummy-selector'), $this->createElement('DummyText'), + 'root', + new CSSLocator('dummy-id', 'dummy-selector'), + $this->createElement('DummyText') ), $searchedElementLocator ); @@ -45,3 +47,5 @@ public function testElementExist(): void ); } } + +class_alias(ElementNotExistsConditionTest::class, 'EzSystems\Behat\Test\Browser\Element\Condition\ElementNotExistsConditionTest'); diff --git a/tests/Browser/Element/Condition/ElementTransitionHasEndedConditionTest.php b/tests/lib/Browser/Element/Condition/ElementTransitionHasEndedConditionTest.php similarity index 85% rename from tests/Browser/Element/Condition/ElementTransitionHasEndedConditionTest.php rename to tests/lib/Browser/Element/Condition/ElementTransitionHasEndedConditionTest.php index 0311307b..818cbda6 100644 --- a/tests/Browser/Element/Condition/ElementTransitionHasEndedConditionTest.php +++ b/tests/lib/Browser/Element/Condition/ElementTransitionHasEndedConditionTest.php @@ -6,12 +6,12 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Condition; +namespace Ibexa\Tests\Behat\Browser\Element\Condition; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Condition\ElementTransitionHasEndedCondition; use Ibexa\Behat\Browser\Element\ElementInterface; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementTransitionHasEndedConditionTest extends BaseTestCase @@ -57,7 +57,7 @@ public function testElementTransitionHasNotStarted(): void Assert::assertFalse($condition->isMet()); Assert::assertEquals( - "Transition has not started at all for element with CSS locator 'searched-id': 'searched-test'. Please make sure the condition is used on the correct element. Timeout value: 1 seconds.", + "Transition has not started at all for element with CSS locator 'searched-id': 'searched-test'. Please make sure that you have performed composer run post-install-cmd command before running tests locally and make sure that the condition is used on the correct element. Timeout value: 1 seconds.", $condition->getErrorMessage($baseElement) ); } @@ -76,3 +76,5 @@ private function createChildElement(bool $hasStartedTransition, bool $hasEndedTr return $childElement; } } + +class_alias(ElementTransitionHasEndedConditionTest::class, 'EzSystems\Behat\Test\Browser\Element\Condition\ElementTransitionHasEndedConditionTest'); diff --git a/tests/Browser/Element/Condition/ElementsCountConditionTest.php b/tests/lib/Browser/Element/Condition/ElementsCountConditionTest.php similarity index 87% rename from tests/Browser/Element/Condition/ElementsCountConditionTest.php rename to tests/lib/Browser/Element/Condition/ElementsCountConditionTest.php index 948b6413..74395a06 100644 --- a/tests/Browser/Element/Condition/ElementsCountConditionTest.php +++ b/tests/lib/Browser/Element/Condition/ElementsCountConditionTest.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Condition; +namespace Ibexa\Tests\Behat\Browser\Element\Condition; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Condition\ElementsCountCondition; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementsCountConditionTest extends BaseTestCase @@ -45,3 +45,5 @@ public function testExpectedCountNotPresent(): void ); } } + +class_alias(ElementsCountConditionTest::class, 'EzSystems\Behat\Test\Browser\Element\Condition\ElementsCountConditionTest'); diff --git a/tests/Browser/Element/Condition/ElementsCountGreaterThanConditionTest.php b/tests/lib/Browser/Element/Condition/ElementsCountGreaterThanConditionTest.php similarity index 86% rename from tests/Browser/Element/Condition/ElementsCountGreaterThanConditionTest.php rename to tests/lib/Browser/Element/Condition/ElementsCountGreaterThanConditionTest.php index 360d5233..24dbdf50 100644 --- a/tests/Browser/Element/Condition/ElementsCountGreaterThanConditionTest.php +++ b/tests/lib/Browser/Element/Condition/ElementsCountGreaterThanConditionTest.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Condition; +namespace Ibexa\Tests\Behat\Browser\Element\Condition; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Condition\ElementsCountGreaterThanCondition; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementsCountGreaterThanConditionTest extends BaseTestCase @@ -45,3 +45,5 @@ public function testExpectedCountNotPresent(): void ); } } + +class_alias(ElementsCountGreaterThanConditionTest::class, 'EzSystems\Behat\Test\Browser\Element\Condition\ElementsCountGreaterThanConditionTest'); diff --git a/tests/Browser/Element/Criterion/ChildElementTextCriterionTest.php b/tests/lib/Browser/Element/Criterion/ChildElementTextCriterionTest.php similarity index 92% rename from tests/Browser/Element/Criterion/ChildElementTextCriterionTest.php rename to tests/lib/Browser/Element/Criterion/ChildElementTextCriterionTest.php index 60ffd3bd..924a998d 100644 --- a/tests/Browser/Element/Criterion/ChildElementTextCriterionTest.php +++ b/tests/lib/Browser/Element/Criterion/ChildElementTextCriterionTest.php @@ -6,13 +6,13 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Criterion; +namespace Ibexa\Tests\Behat\Browser\Element\Criterion; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Criterion\ChildElementTextCriterion; use Ibexa\Behat\Browser\Locator\CSSLocator; use Ibexa\Behat\Browser\Locator\LocatorInterface; use Ibexa\Behat\Browser\Locator\XPathLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ChildElementTextCriterionTest extends BaseTestCase @@ -69,3 +69,5 @@ public function testGetErrorMessageWhenOtherElementFound(): void ); } } + +class_alias(ChildElementTextCriterionTest::class, 'EzSystems\Behat\Test\Browser\Element\Criterion\ChildElementTextCriterionTest'); diff --git a/tests/Browser/Element/Criterion/ElementAttributeCriterionTest.php b/tests/lib/Browser/Element/Criterion/ElementAttributeCriterionTest.php similarity index 91% rename from tests/Browser/Element/Criterion/ElementAttributeCriterionTest.php rename to tests/lib/Browser/Element/Criterion/ElementAttributeCriterionTest.php index 22c904fe..27af84ea 100644 --- a/tests/Browser/Element/Criterion/ElementAttributeCriterionTest.php +++ b/tests/lib/Browser/Element/Criterion/ElementAttributeCriterionTest.php @@ -6,12 +6,12 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Criterion; +namespace Ibexa\Tests\Behat\Browser\Element\Criterion; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Criterion\ElementAttributeCriterion; use Ibexa\Behat\Browser\Element\ElementInterface; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementAttributeCriterionTest extends BaseTestCase @@ -66,3 +66,5 @@ private function createElementWithAttribute($attribute, $value): ElementInterfac return $element; } } + +class_alias(ElementAttributeCriterionTest::class, 'EzSystems\Behat\Test\Browser\Element\Criterion\ElementAttributeCriterionTest'); diff --git a/tests/Browser/Element/Criterion/ElementTextCriterionTest.php b/tests/lib/Browser/Element/Criterion/ElementTextCriterionTest.php similarity index 88% rename from tests/Browser/Element/Criterion/ElementTextCriterionTest.php rename to tests/lib/Browser/Element/Criterion/ElementTextCriterionTest.php index 9f119646..9cb6b032 100644 --- a/tests/Browser/Element/Criterion/ElementTextCriterionTest.php +++ b/tests/lib/Browser/Element/Criterion/ElementTextCriterionTest.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Criterion; +namespace Ibexa\Tests\Behat\Browser\Element\Criterion; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementTextCriterionTest extends BaseTestCase @@ -56,3 +56,5 @@ public function testGetErrorMessageWhenCollectionIsEmpty(): void ); } } + +class_alias(ElementTextCriterionTest::class, 'EzSystems\Behat\Test\Browser\Element\Criterion\ElementTextCriterionTest'); diff --git a/tests/Browser/Element/Criterion/ElementTextFragmentCriterionTest.php b/tests/lib/Browser/Element/Criterion/ElementTextFragmentCriterionTest.php similarity index 88% rename from tests/Browser/Element/Criterion/ElementTextFragmentCriterionTest.php rename to tests/lib/Browser/Element/Criterion/ElementTextFragmentCriterionTest.php index 06bc2cf8..ff1f723e 100644 --- a/tests/Browser/Element/Criterion/ElementTextFragmentCriterionTest.php +++ b/tests/lib/Browser/Element/Criterion/ElementTextFragmentCriterionTest.php @@ -6,11 +6,11 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Criterion; +namespace Ibexa\Tests\Behat\Browser\Element\Criterion; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Criterion\ElementTextFragmentCriterion; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class ElementTextFragmentCriterionTest extends BaseTestCase @@ -56,3 +56,5 @@ public function testGetErrorMessageWhenNoElementFound(): void ); } } + +class_alias(ElementTextFragmentCriterionTest::class, 'EzSystems\Behat\Test\Browser\Element\Criterion\ElementTextFragmentCriterionTest'); diff --git a/tests/Browser/Element/Criterion/LogicalOrCriterionTest.php b/tests/lib/Browser/Element/Criterion/LogicalOrCriterionTest.php similarity index 83% rename from tests/Browser/Element/Criterion/LogicalOrCriterionTest.php rename to tests/lib/Browser/Element/Criterion/LogicalOrCriterionTest.php index 2d3c684d..a12238d2 100644 --- a/tests/Browser/Element/Criterion/LogicalOrCriterionTest.php +++ b/tests/lib/Browser/Element/Criterion/LogicalOrCriterionTest.php @@ -6,12 +6,12 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Criterion; +namespace Ibexa\Tests\Behat\Browser\Element\Criterion; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion; use Ibexa\Behat\Browser\Element\Criterion\LogicalOrCriterion; use Ibexa\Behat\Browser\Locator\CSSLocator; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; class LogicalOrCriterionTest extends BaseTestCase @@ -38,7 +38,8 @@ public function testNoMatchWhenNoCriterionMatches(): void $nonmatchingElement = $this->createElement('Test3'); Assert::assertFalse($testedCriterion->matches($nonmatchingElement)); - Assert::assertEquals("LogicalOr criterion failed. Condition error messages: + Assert::assertEquals( + "LogicalOr criterion failed. Condition error messages: Could not find element named: 'Test1'. Found names: Test3 instead. CSS locator 'id': 'selector'. Could not find element named: 'Test2'. Found names: Test3 instead. CSS locator 'id': 'selector'. ", @@ -46,3 +47,5 @@ public function testNoMatchWhenNoCriterionMatches(): void ); } } + +class_alias(LogicalOrCriterionTest::class, 'EzSystems\Behat\Test\Browser\Element\Criterion\LogicalOrCriterionTest'); diff --git a/tests/Browser/Element/Debug/Assert/Interactive/CollectionAssertTest.php b/tests/lib/Browser/Element/Debug/Assert/Interactive/CollectionAssertTest.php similarity index 77% rename from tests/Browser/Element/Debug/Assert/Interactive/CollectionAssertTest.php rename to tests/lib/Browser/Element/Debug/Assert/Interactive/CollectionAssertTest.php index b652ef7b..4dae0711 100644 --- a/tests/Browser/Element/Debug/Assert/Interactive/CollectionAssertTest.php +++ b/tests/lib/Browser/Element/Debug/Assert/Interactive/CollectionAssertTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Debug\Assert\Interactive; +namespace Ibexa\Tests\Behat\Browser\Element\Debug\Assert\Interactive; use Ibexa\Behat\Browser\Assert\CollectionAssertInterface; use Ibexa\Behat\Browser\Assert\Debug\Interactive\CollectionAssert; @@ -22,3 +22,5 @@ public function testShouldBeInitializable(): void Assert::assertInstanceOf(CollectionAssert::class, $collectionAssert); } } + +class_alias(CollectionAssertTest::class, 'EzSystems\Behat\Test\Browser\Element\Debug\Assert\Interactive\CollectionAssertTest'); diff --git a/tests/Browser/Element/Debug/Assert/Interactive/ElementAssertTest.php b/tests/lib/Browser/Element/Debug/Assert/Interactive/ElementAssertTest.php similarity index 77% rename from tests/Browser/Element/Debug/Assert/Interactive/ElementAssertTest.php rename to tests/lib/Browser/Element/Debug/Assert/Interactive/ElementAssertTest.php index 8f6f7af8..32f7c81f 100644 --- a/tests/Browser/Element/Debug/Assert/Interactive/ElementAssertTest.php +++ b/tests/lib/Browser/Element/Debug/Assert/Interactive/ElementAssertTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Debug\Assert\Interactive; +namespace Ibexa\Tests\Behat\Browser\Element\Debug\Assert\Interactive; use Ibexa\Behat\Browser\Assert\Debug\Interactive\ElementAssert; use Ibexa\Behat\Browser\Assert\ElementAssertInterface; @@ -22,3 +22,5 @@ public function testShouldBeInitializable(): void Assert::assertInstanceOf(ElementAssert::class, $collectionAssert); } } + +class_alias(ElementAssertTest::class, 'EzSystems\Behat\Test\Browser\Element\Debug\Assert\Interactive\ElementAssertTest'); diff --git a/tests/Browser/Element/Debug/HighlightingElementTest.php b/tests/lib/Browser/Element/Debug/HighlightingElementTest.php similarity index 80% rename from tests/Browser/Element/Debug/HighlightingElementTest.php rename to tests/lib/Browser/Element/Debug/HighlightingElementTest.php index 972ebb7a..95e52fca 100644 --- a/tests/Browser/Element/Debug/HighlightingElementTest.php +++ b/tests/lib/Browser/Element/Debug/HighlightingElementTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Debug; +namespace Ibexa\Tests\Behat\Browser\Element\Debug; use Behat\Mink\Session; use Ibexa\Behat\Browser\Element\Debug\Highlighting\Element; @@ -23,3 +23,5 @@ public function testShouldBeInitializable(): void Assert::assertInstanceOf(Element::class, $element); } } + +class_alias(HighlightingElementTest::class, 'EzSystems\Behat\Test\Browser\Element\Debug\HighlightingElementTest'); diff --git a/tests/Browser/Element/Debug/InteractiveElementTest.php b/tests/lib/Browser/Element/Debug/InteractiveElementTest.php similarity index 79% rename from tests/Browser/Element/Debug/InteractiveElementTest.php rename to tests/lib/Browser/Element/Debug/InteractiveElementTest.php index a86bdd4b..82419be5 100644 --- a/tests/Browser/Element/Debug/InteractiveElementTest.php +++ b/tests/lib/Browser/Element/Debug/InteractiveElementTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Debug; +namespace Ibexa\Tests\Behat\Browser\Element\Debug; use Ibexa\Behat\Browser\Element\Debug\Interactive\Element; use Ibexa\Behat\Browser\Element\ElementInterface; @@ -22,3 +22,5 @@ public function testShouldBeInitializable(): void Assert::assertInstanceOf(Element::class, $element); } } + +class_alias(InteractiveElementTest::class, 'EzSystems\Behat\Test\Browser\Element\Debug\InteractiveElementTest'); diff --git a/tests/Browser/Element/ElementCollectionTest.php b/tests/lib/Browser/Element/ElementCollectionTest.php similarity index 92% rename from tests/Browser/Element/ElementCollectionTest.php rename to tests/lib/Browser/Element/ElementCollectionTest.php index 756abd24..b8500e0f 100644 --- a/tests/Browser/Element/ElementCollectionTest.php +++ b/tests/lib/Browser/Element/ElementCollectionTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element; +namespace Ibexa\Tests\Behat\Browser\Element; use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion; use Ibexa\Behat\Browser\Element\ElementInterface; @@ -25,7 +25,9 @@ protected function setUp(): void { $this->collection = $this->createCollection( new CSSLocator('identifier', 'selector'), - 'Element1', 'Element2', 'Element3' + 'Element1', + 'Element2', + 'Element3' ); } @@ -135,7 +137,9 @@ public function testFilterBy(): void { $collection = $this->createCollection( new CSSLocator('identifier', 'selector'), - 'AAA', 'AAA', 'ZZZ' + 'AAA', + 'AAA', + 'ZZZ' ); Assert::assertEquals( @@ -148,7 +152,9 @@ public function testFilter(): void { $collection = $this->createCollection( new CSSLocator('identifier', 'selector'), - 'AAA', 'AAA', 'ZZZ' + 'AAA', + 'AAA', + 'ZZZ' ); Assert::assertEquals( @@ -163,7 +169,9 @@ public function testGetBy(): void { $collection = $this->createCollection( new CSSLocator('identifier', 'selector'), - 'AAA', 'BBB', 'ZZZ' + 'AAA', + 'BBB', + 'ZZZ' ); Assert::assertEquals( @@ -176,7 +184,9 @@ public function testGet(): void { $collection = $this->createCollection( new CSSLocator('identifier', 'selector'), - 'AAA', 'BBB', 'ZZZ' + 'AAA', + 'BBB', + 'ZZZ' ); Assert::assertEquals( @@ -187,3 +197,5 @@ public function testGet(): void ); } } + +class_alias(ElementCollectionTest::class, 'EzSystems\Behat\Test\Browser\Element\ElementCollectionTest'); diff --git a/tests/Browser/Element/ElementTest.php b/tests/lib/Browser/Element/ElementTest.php similarity index 98% rename from tests/Browser/Element/ElementTest.php rename to tests/lib/Browser/Element/ElementTest.php index 38839f9b..b40ad725 100644 --- a/tests/Browser/Element/ElementTest.php +++ b/tests/lib/Browser/Element/ElementTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element; +namespace Ibexa\Tests\Behat\Browser\Element; use Behat\Mink\Element\NodeElement; use Ibexa\Behat\Browser\Element\Condition\ElementExistsCondition; @@ -183,3 +183,5 @@ private function createElementWithMinkElement(NodeELement $nodeElement) return new Element(new ElementFactory(), $this->irrelevantLocator, $nodeElement); } } + +class_alias(ElementTest::class, 'EzSystems\Behat\Test\Browser\Element\ElementTest'); diff --git a/tests/lib/Browser/Element/Mapper/ElementAttributeMapperTest.php b/tests/lib/Browser/Element/Mapper/ElementAttributeMapperTest.php new file mode 100644 index 00000000..3d049e32 --- /dev/null +++ b/tests/lib/Browser/Element/Mapper/ElementAttributeMapperTest.php @@ -0,0 +1,32 @@ +mapper = new ElementAttributeMapper('data-id'); + } + + public function testMapsSingleElement(): void + { + $element = $this->createStub(ElementInterface::class); + $element->method('getAttribute')->willReturn('AttributeValue'); + + Assert::assertEquals('AttributeValue', $this->mapper->map($element)); + } +} diff --git a/tests/Browser/Element/Mapper/TextMapperTestCase.php b/tests/lib/Browser/Element/Mapper/ElementTextMapperTest.php similarity index 72% rename from tests/Browser/Element/Mapper/TextMapperTestCase.php rename to tests/lib/Browser/Element/Mapper/ElementTextMapperTest.php index 1b371be6..5b84c7f8 100644 --- a/tests/Browser/Element/Mapper/TextMapperTestCase.php +++ b/tests/lib/Browser/Element/Mapper/ElementTextMapperTest.php @@ -6,13 +6,13 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Element\Mapper; +namespace Ibexa\Tests\Behat\Browser\Element\Mapper; -use EzSystems\Behat\Test\Browser\Element\BaseTestCase; use Ibexa\Behat\Browser\Element\Mapper\ElementTextMapper; +use Ibexa\Tests\Behat\Browser\Element\BaseTestCase; use PHPUnit\Framework\Assert; -class TextMapperTestCase extends BaseTestCase +class ElementTextMapperTest extends BaseTestCase { /** @var \Ibexa\Behat\Browser\Element\Mapper\ElementTextMapper */ private $mapper; @@ -29,3 +29,5 @@ public function testMapsSingleElement(): void Assert::assertEquals('Element1', $this->mapper->map($element)); } } + +class_alias(TextMapperTestCase::class, 'EzSystems\Behat\Test\Browser\Element\Mapper\TextMapperTestCase'); diff --git a/tests/Browser/Filter/BrowserLogFilterTest.php b/tests/lib/Browser/Filter/BrowserLogFilterTest.php similarity index 82% rename from tests/Browser/Filter/BrowserLogFilterTest.php rename to tests/lib/Browser/Filter/BrowserLogFilterTest.php index 1f9952f0..daee2167 100644 --- a/tests/Browser/Filter/BrowserLogFilterTest.php +++ b/tests/lib/Browser/Filter/BrowserLogFilterTest.php @@ -6,7 +6,7 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Browser\Filter; +namespace Ibexa\Tests\Behat\Browser\Filter; use Ibexa\Behat\Browser\Filter\BrowserLogFilter; use PHPUnit\Framework\Assert; @@ -14,6 +14,7 @@ /** * @internal + * * @coversNothing */ class BrowserLogFilterTest extends TestCase @@ -21,8 +22,8 @@ class BrowserLogFilterTest extends TestCase public function testFiltersOutExcludedPatterns() { $initialLogEntries = [ - 'http://web/api/ezp/v2/bookmark/43 - Failed to load resource: the server responded with a status of 404 (Not Found)', - 'https://varnish/api/ezp/v2/bookmark/1 - Failed to load resource: the server responded with a status of 404 (Not Found)', + 'http://web/api/ibexa/v2/bookmark/43 - Failed to load resource: the server responded with a status of 404 (Not Found)', + 'https://varnish/api/ibexa/v2/bookmark/1 - Failed to load resource: the server responded with a status of 404 (Not Found)', 'Real JS Error', 'http://varnish/bundles/netgentags/admin/jstree/js/jstree.min.js 5 document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.', 'https://web/bundles/netgentags/admin/jstree/js/jstree.min.js 5 document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.', @@ -38,3 +39,5 @@ public function testFiltersOutExcludedPatterns() Assert::assertEquals(['Real JS Error', 'Another real JS error'], $actualResult); } } + +class_alias(BrowserLogFilterTest::class, 'EzSystems\Behat\Test\Browser\Filter\BrowserLogFilterTest'); diff --git a/tests/Core/Behat/ArgumentParserTest.php b/tests/lib/Core/Behat/ArgumentParserTest.php similarity index 78% rename from tests/Core/Behat/ArgumentParserTest.php rename to tests/lib/Core/Behat/ArgumentParserTest.php index 9ff07d27..dab481e0 100644 --- a/tests/Core/Behat/ArgumentParserTest.php +++ b/tests/lib/Core/Behat/ArgumentParserTest.php @@ -6,16 +6,17 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Core\Behat; +namespace Ibexa\Tests\Behat\Core\Behat; -use EzSystems\Behat\API\Facade\RoleFacade; -use EzSystems\Behat\Core\Behat\ArgumentParser; +use Ibexa\Behat\API\Facade\RoleFacade; use Ibexa\Behat\Browser\Environment\ParameterProvider; +use Ibexa\Behat\Core\Behat\ArgumentParser; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; /** * @internal + * * @coversNothing */ class ArgumentParserTest extends TestCase @@ -40,6 +41,10 @@ public static function provideUrlData() return [ ['', '/'], ['root', '/'], + ['/root', '/'], + ['/root/taxonomy', '/taxonomy'], + ['root/taxonomy', '/taxonomy'], + ['/taxonomy/tags/root', '/taxonomy/tags/root'], ['/', '/'], ['/Home', '/Home'], ['Home', '/Home'], @@ -52,3 +57,5 @@ public static function provideUrlData() ]; } } + +class_alias(ArgumentParserTest::class, 'EzSystems\Behat\Test\Core\Behat\ArgumentParserTest'); diff --git a/tests/Core/Behat/ExtendedTableNodeTest.php b/tests/lib/Core/Behat/ExtendedTableNodeTest.php similarity index 94% rename from tests/Core/Behat/ExtendedTableNodeTest.php rename to tests/lib/Core/Behat/ExtendedTableNodeTest.php index c602a52e..2d59634b 100644 --- a/tests/Core/Behat/ExtendedTableNodeTest.php +++ b/tests/lib/Core/Behat/ExtendedTableNodeTest.php @@ -6,18 +6,20 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Core\Behat; +namespace Ibexa\Tests\Behat\Core\Behat; use Behat\Gherkin\Node\TableNode; -use EzSystems\Behat\Core\Behat\TableNodeExtension; +use Ibexa\Behat\Core\Behat\TableNodeExtension; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; /** * @copyright Copyright (C) eZ Systems AS. All rights reserved. + * * @license For full copyright and license information view LICENSE file distributed with this source code. * * @internal + * * @coversNothing */ class ExtendedTableNodeTest extends TestCase @@ -87,3 +89,5 @@ public function testCanRemoveColumn() ['Value21', 'Value23'], ], $afterTable->getTable()); } } + +class_alias(ExtendedTableNodeTest::class, 'EzSystems\Behat\Test\Core\Behat\ExtendedTableNodeTest'); diff --git a/tests/Core/Configuration/ConfigurationEditorTest.php b/tests/lib/Core/Configuration/ConfigurationEditorTest.php similarity index 93% rename from tests/Core/Configuration/ConfigurationEditorTest.php rename to tests/lib/Core/Configuration/ConfigurationEditorTest.php index 15169646..d11f31c6 100644 --- a/tests/Core/Configuration/ConfigurationEditorTest.php +++ b/tests/lib/Core/Configuration/ConfigurationEditorTest.php @@ -6,14 +6,15 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Core\Configuration; +namespace Ibexa\Tests\Behat\Core\Configuration; -use EzSystems\Behat\Core\Configuration\ConfigurationEditor; +use Ibexa\Behat\Core\Configuration\ConfigurationEditor; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; /** * @internal + * * @coversNothing */ class ConfigurationEditorTest extends TestCase @@ -283,4 +284,16 @@ public function testGetMultipleValues() Assert::assertEquals(['initialValue1', 'initialValue2'], $value); } + + public function testCopiesKey(): void + { + $configurationEditor = new ConfigurationEditor(); + $initialConfig = ['baseKey' => ['initialValue1' => 'nestedValue1', 'initialValue2']]; + + $changedConfig = $configurationEditor->copyKey($initialConfig, 'baseKey.initialValue1', 'baseKey.copiedKey'); + + Assert::assertEquals(['baseKey' => ['initialValue1' => 'nestedValue1', 'initialValue2', 'copiedKey' => 'nestedValue1']], $changedConfig); + } } + +class_alias(ConfigurationEditorTest::class, 'EzSystems\Behat\Test\Core\Configuration\ConfigurationEditorTest'); diff --git a/tests/Core/Configuration/LocationAwareConfigurationEditorTest.php b/tests/lib/Core/Configuration/LocationAwareConfigurationEditorTest.php similarity index 86% rename from tests/Core/Configuration/LocationAwareConfigurationEditorTest.php rename to tests/lib/Core/Configuration/LocationAwareConfigurationEditorTest.php index f44b5d99..2bb31277 100644 --- a/tests/Core/Configuration/LocationAwareConfigurationEditorTest.php +++ b/tests/lib/Core/Configuration/LocationAwareConfigurationEditorTest.php @@ -6,17 +6,18 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Core\Configuration; +namespace Ibexa\Tests\Behat\Core\Configuration; -use eZ\Publish\Core\Repository\Values\Content\Location; -use EzSystems\Behat\API\Facade\ContentFacade; -use EzSystems\Behat\Core\Configuration\ConfigurationEditor; -use EzSystems\Behat\Core\Configuration\LocationAwareConfigurationEditor; +use Ibexa\Behat\API\Facade\ContentFacade; +use Ibexa\Behat\Core\Configuration\ConfigurationEditor; +use Ibexa\Behat\Core\Configuration\LocationAwareConfigurationEditor; +use Ibexa\Core\Repository\Values\Content\Location; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; /** * @internal + * * @coversNothing */ class LocationAwareConfigurationEditorTest extends TestCase @@ -89,3 +90,5 @@ public function testReplacesValueWhenAppendIsUsed() Assert::assertEquals(['testKey' => [2, 5]], $config); } } + +class_alias(LocationAwareConfigurationEditorTest::class, 'EzSystems\Behat\Test\Core\Configuration\LocationAwareConfigurationEditorTest'); diff --git a/tests/Core/Log/LogFileReaderTest.php b/tests/lib/Core/Log/LogFileReaderTest.php similarity index 88% rename from tests/Core/Log/LogFileReaderTest.php rename to tests/lib/Core/Log/LogFileReaderTest.php index 09acff98..7ed42d45 100644 --- a/tests/Core/Log/LogFileReaderTest.php +++ b/tests/lib/Core/Log/LogFileReaderTest.php @@ -6,15 +6,16 @@ */ declare(strict_types=1); -namespace EzSystems\Behat\Test\Core\Log; +namespace Ibexa\Tests\Behat\Core\Log; -use EzSystems\Behat\Core\Log\LogFileReader; +use Ibexa\Behat\Core\Log\LogFileReader; use org\bovigo\vfs\vfsStream; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; /** * @internal + * * @coversNothing */ class LogFileReaderTest extends TestCase @@ -24,7 +25,7 @@ class LogFileReaderTest extends TestCase /** @var \org\bovigo\vfs\vfsStreamDirectory */ private $fileSystemRoot; - /** @var \EzSystems\Behat\Core\Log\LogFileReader */ + /** @var \Ibexa\Behat\Core\Log\LogFileReader */ private $logReader; public function setUp(): void @@ -79,3 +80,5 @@ public function testReturnsCorrectArrayWhenThereIsMoreLogsThanLimit() Assert::assertEquals([2, 3, 4, 5, 6], $logEntries); } } + +class_alias(LogFileReaderTest::class, 'EzSystems\Behat\Test\Core\Log\LogFileReaderTest');