diff --git a/.github/workflows/browser-tests.yaml b/.github/workflows/browser-tests.yaml index cb3ae440..529a9f04 100644 --- a/.github/workflows/browser-tests.yaml +++ b/.github/workflows/browser-tests.yaml @@ -17,13 +17,11 @@ jobs: test-suite: "--mode=standard --profile=browser --suite=admin-ui-full --tags='~@broken&&~@IbexaDXP'" multirepository: true timeout: 40 - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + secrets: inherit examples: name: "BehatBundle examples" uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main with: project-edition: 'oss' test-suite: '--mode=standard --profile=service --suite=examples' - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + secrets: inherit diff --git a/behat_ibexa_commerce.yaml b/behat_ibexa_commerce.yaml index 2d78277c..9ac323c7 100644 --- a/behat_ibexa_commerce.yaml +++ b/behat_ibexa_commerce.yaml @@ -24,6 +24,7 @@ regression: - '%paths.base%/vendor/ibexa/discounts/features/setup/setup.feature' - '%paths.base%/vendor/ibexa/discounts-codes/features/setup/setup.feature' - '%paths.base%/vendor/ibexa/activity-log/features/setup/setup.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/userSettings/help_center.feature' contexts: - Ibexa\Behat\API\Context\ContentContext - Ibexa\Behat\API\Context\ContentTypeContext @@ -35,6 +36,11 @@ regression: - Ibexa\Behat\Core\Context\FileContext - Ibexa\Migration\Behat\Context\MigrationContext - Ibexa\ProductCatalog\Behat\Context\CatalogsContext + - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext + - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext + - Ibexa\Behat\Browser\Context\AuthenticationContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext + - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext commerce: paths: - '%paths.base%/vendor/ibexa/admin-ui/features/personas' diff --git a/behat_ibexa_experience.yaml b/behat_ibexa_experience.yaml index 30a0f70e..ac58a311 100644 --- a/behat_ibexa_experience.yaml +++ b/behat_ibexa_experience.yaml @@ -28,6 +28,7 @@ regression: - '%paths.base%/vendor/ibexa/dashboard/features/setup/setup.feature' - '%paths.base%/vendor/ibexa/connector-openai/features/setup/setup.feature' - '%paths.base%/vendor/ibexa/activity-log/features/setup/setup.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/userSettings/help_center.feature' contexts: - Ibexa\Behat\API\Context\ContentContext - Ibexa\Behat\API\Context\ContentTypeContext @@ -38,6 +39,11 @@ regression: - Ibexa\Behat\Core\Context\ConfigurationContext - Ibexa\Behat\Core\Context\FileContext - Ibexa\Migration\Behat\Context\MigrationContext + - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext + - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext + - Ibexa\Behat\Browser\Context\AuthenticationContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext + - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext experience: paths: - '%paths.base%/vendor/ibexa/admin-ui/features/personas' diff --git a/behat_ibexa_headless.yaml b/behat_ibexa_headless.yaml index e3f7420d..ae3da958 100644 --- a/behat_ibexa_headless.yaml +++ b/behat_ibexa_headless.yaml @@ -18,6 +18,7 @@ regression: - '%paths.base%/vendor/ibexa/behat/features/setup/contentTranslation' - '%paths.base%/vendor/ibexa/product-catalog/features/setup/setup.feature' - '%paths.base%/vendor/ibexa/connector-openai/features/setup/setup.feature' + - '%paths.base%/vendor/ibexa/behat/features/setup/userSettings/help_center.feature' contexts: - Ibexa\Behat\API\Context\ContentContext - Ibexa\Behat\API\Context\ContentTypeContext @@ -28,6 +29,11 @@ regression: - Ibexa\Behat\Core\Context\FileContext - Ibexa\Behat\API\Context\LanguageContext - Ibexa\Migration\Behat\Context\MigrationContext + - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext + - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext + - Ibexa\Behat\Browser\Context\AuthenticationContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext + - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext headless: paths: - '%paths.base%/vendor/ibexa/admin-ui/features/personas' diff --git a/behat_suites.yml b/behat_suites.yml index d6989ae4..d2884601 100644 --- a/behat_suites.yml +++ b/behat_suites.yml @@ -86,3 +86,12 @@ setup: - Ibexa\Behat\Core\Context\ConfigurationContext - Ibexa\Behat\API\Context\LanguageContext - Ibexa\Behat\API\Context\TestContext + user-settings: + paths: + - '%paths.base%/vendor/ibexa/behat/features/setup/userSettings' + contexts: + - Ibexa\AdminUi\Behat\BrowserContext\UserPreferencesContext + - Ibexa\AdminUi\Behat\BrowserContext\NavigationContext + - Ibexa\Behat\Browser\Context\AuthenticationContext + - Ibexa\AdminUi\Behat\BrowserContext\ContentActionsMenuContext + - Ibexa\AdminUi\Behat\BrowserContext\NotificationContext diff --git a/features/setup/userSettings/help_center.feature b/features/setup/userSettings/help_center.feature new file mode 100644 index 00000000..591109af --- /dev/null +++ b/features/setup/userSettings/help_center.feature @@ -0,0 +1,11 @@ +Feature: Disable Help center in user settings + + @admin @setup @helpCenter @javascript + Scenario: Disable Help center in user settings + Given I open Login page in admin SiteAccess + When I log in as admin with password publish + And I'm on Content view Page for root + And I go to user settings + When I disable Help center + And I perform the "Save and close" action + Then success notification that "User settings 'browsing' updated." appears diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 303e5701..ba877b4f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1350,12 +1350,6 @@ parameters: count: 1 path: src/lib/API/Facade/UserFacade.php - - - message: '#^Call to function array_key_exists\(\) with ''function'' and array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php - - message: '#^Invalid type Exception\|null to throw\.$#' identifier: throw.notThrowable @@ -1386,12 +1380,6 @@ parameters: count: 1 path: src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php - - - message: '#^Offset ''file'' might not exist on array\{function\: ''eval'', line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php - - message: '#^PHPDoc tag @var above a method has no effect\.$#' identifier: varTag.misplaced @@ -1410,12 +1398,6 @@ parameters: count: 2 path: src/lib/Browser/Assert/Debug/Interactive/CollectionAssert.php - - - message: '#^Call to function array_key_exists\(\) with ''function'' and array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php - - message: '#^Call to method hasClass\(\) on an unknown class Ibexa\\Behat\\Browseer\\Assert\\ElementAssertInterface\.$#' identifier: class.notFound @@ -1470,12 +1452,6 @@ parameters: count: 1 path: src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php - - - message: '#^Offset ''file'' might not exist on array\{function\: ''eval'', line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/lib/Browser/Assert/Debug/Interactive/ElementAssert.php - - message: '#^PHPDoc tag @var above a method has no effect\.$#' identifier: varTag.misplaced @@ -1782,12 +1758,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Highlighting/RootElement.php - - - message: '#^Call to function array_key_exists\(\) with ''function'' and array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/BaseElement.php - - message: '#^Invalid type Exception\|null to throw\.$#' identifier: throw.notThrowable @@ -1818,12 +1788,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Interactive/BaseElement.php - - - message: '#^Offset ''file'' might not exist on array\{function\: ''eval'', line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/BaseElement.php - - message: '#^PHPDoc tag @var above a method has no effect\.$#' identifier: varTag.misplaced @@ -1950,12 +1914,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Interactive/Element.php - - - message: '#^Call to function array_key_exists\(\) with ''function'' and array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/Element.php - - message: '#^Invalid type Exception\|null to throw\.$#' identifier: throw.notThrowable @@ -2004,12 +1962,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Interactive/Element.php - - - message: '#^Offset ''file'' might not exist on array\{function\: ''eval'', line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/Element.php - - message: '#^PHPDoc tag @var above a method has no effect\.$#' identifier: varTag.misplaced @@ -2028,12 +1980,6 @@ parameters: count: 2 path: src/lib/Browser/Element/Debug/Interactive/Element.php - - - message: '#^Call to function array_key_exists\(\) with ''function'' and array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/ElementCollection.php - - message: '#^Invalid type Exception\|null to throw\.$#' identifier: throw.notThrowable @@ -2064,12 +2010,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Interactive/ElementCollection.php - - - message: '#^Offset ''file'' might not exist on array\{function\: ''eval'', line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/ElementCollection.php - - message: '#^PHPDoc tag @var above a method has no effect\.$#' identifier: varTag.misplaced @@ -2106,12 +2046,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Interactive/RootElement.php - - - message: '#^Call to function array_key_exists\(\) with ''function'' and array\{function\: string, line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\} will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/RootElement.php - - message: '#^Invalid type Exception\|null to throw\.$#' identifier: throw.notThrowable @@ -2142,12 +2076,6 @@ parameters: count: 1 path: src/lib/Browser/Element/Debug/Interactive/RootElement.php - - - message: '#^Offset ''file'' might not exist on array\{function\: ''eval'', line\?\: int, file\?\: string, class\?\: class\-string, type\?\: ''\-\>''\|''\:\:'', args\?\: array\, object\?\: object\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/lib/Browser/Element/Debug/Interactive/RootElement.php - - message: '#^PHPDoc tag @var above a method has no effect\.$#' identifier: varTag.misplaced diff --git a/src/lib/Core/Debug/InteractiveDebuggerTrait.php b/src/lib/Core/Debug/InteractiveDebuggerTrait.php index d9ac8aa5..1033feac 100644 --- a/src/lib/Core/Debug/InteractiveDebuggerTrait.php +++ b/src/lib/Core/Debug/InteractiveDebuggerTrait.php @@ -83,9 +83,8 @@ private function getCallingComponent(): Component { $trace = debug_backtrace(); foreach ($trace as $traceLine) { - if (!array_key_exists('function', $traceLine) || - $traceLine['function'] === 'eval' || - !array_key_exists('object', $traceLine) + if ($traceLine['function'] === 'eval' || + !array_key_exists('object', $traceLine) ) { continue; } @@ -106,7 +105,9 @@ private function isRunningInteractive(): bool $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5); foreach ($trace as $traceEntry) { - if ($traceEntry['function'] === 'eval' && strpos($traceEntry['file'], 'psy/psysh') !== 0) { + if ($traceEntry['function'] === 'eval' && + array_key_exists('file', $traceEntry) && + strpos($traceEntry['file'], 'psy/psysh') !== 0) { return true; } }