Files
piratepoet/mailpoet/tasks/phpstan/phpstan.neon
Rodrigo Primo ef8bc9250a Change codeception extension to catch skipped tests
This commit changes the Codeception extension CheckSkippedTestsExtension
that we use to generate an error when tests are skipped in the `trunk` and
`release` branches. Now this extension accepts a list of tests that can
be skipped in those two branches. This will be necessary as part of the
project to support WooCommerce Custom Orders Tables as in some scenarios
we want to skip WooCommerce Subscriptions tests and in some we don't.
For now, WooCommerce Subscrptions doesn't support Woo COT, so we want to
run Woo Subscriptions tests when COT is disabled, but we want to skip
then when COT is enabled.

The main change is that now we are using the `TEST_SKIPPED` Codeception event
instead of the `SUITE_AFTER` event. This change was necessary as in the
latter event we don't have any information about the tests that were
skipped.

[MAILPOET-4695]
2022-10-06 12:16:47 +02:00

95 lines
4.6 KiB
Plaintext

parameters:
level: 9
tmpDir: ../../temp/phpstan
bootstrapFiles:
- ../../vendor/autoload.php
- bootstrap.php
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
- vendor/php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
- ../../vendor/codeception/codeception/autoload.php
- ../../vendor/codeception/verify/src/Codeception/function.php
- ../../vendor/codeception/verify/src/Codeception/Verify/Verify.php
- ../../tests/_support/_generated/AcceptanceTesterActions.php
- ../../tests/_support/_generated/IntegrationTesterActions.php
- ../../tests/_support/_generated/UnitTesterActions.php
scanDirectories:
- ../../tests/_support
- ../../tests/acceptance
- ../../tests/integration
- ../../tests/unit
scanFiles:
- PremiumContainerConfigurator.php
- ../../vendor-prefixed/twig/twig/src/Extension/CoreExtension.php # phpstan can't find \MailPoetVendor\twig_include function
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
- custom-stubs.php
inferPrivatePropertyTypeFromConstructor: true
parallel:
processTimeout: 300.0
maximumNumberOfProcesses: 4
ignoreErrors:
- '#Function members_register_.+ not found#'
- '#Call to an undefined method MailPoetVendor\\Idiorm\\IdiormResultSet::set\(\)#'
- '#Argument of an invalid type MailPoetVendor\\pQuery\\IQuery supplied for foreach, only iterables are supported#'
# exclude level 6 errors (but keep them for Automation)
- '/(Method|Property|Function) (?!MailPoet\\Automation\\).*has no (return )?type specified/'
- '/(Method|Function) (?!MailPoet\\Automation\\).*has parameter (\$[_A-Z]{1}[_a-z]+)? with no type (specified)?/i'
- # Primary keys ScheduledTaskSubscriberEntity of are foreign keys and foreign keys may be null because of missing related record
message: '#Property MailPoet\\Entities\\[a-zA-Z]+::\$[a-z]+ type mapping mismatch: property can contain MailPoet\\Entities\\[a-zA-Z]+\|null but database expects MailPoet\\Entities\\[a-zA-Z]+.#'
path: ../../lib/Entities/ScheduledTaskSubscriberEntity.php
count: 2
- '/Parameter #1 \$cssOrXPath of method AcceptanceTester::moveMouseOver\(\) expects string\|null, array<string, string> given./'
- '/Function expect invoked with 1 parameter, 0 required\./'
- '/Call to method getName\(\) on an unknown class _generated\\([a-zA-Z])*Cookie/' # codeception generate incorrect return type in ../../tests/_support/_generated
- '/Call to static method container\(\) on an unknown class/'
- '/Class Automattic\\WooCommerce\\StoreApi\\Schemas\\ExtendSchema not found./'
-
message: "#^Cannot cast string|void to string\\.$#"
count: 2
path: ../../lib/Automation/Engine/Storage/WorkflowRunStorage.php
-
message: "#^Cannot cast string|void to string\\.$#"
count: 5
path: ../../lib/Automation/Engine/Storage/WorkflowStorage.php
-
message: '/^Call to static method custom_orders_table_usage_is_enabled\(\) on an unknown class Automattic\\WooCommerce\\Utilities\\OrderUtil\.$/'
count: 1
path: ../../lib/WooCommerce/Helper.php
-
message: '/^Call to static method get_orders_table_name\(\) on an unknown class Automattic\\WooCommerce\\Internal\\DataStores\\Orders\\OrdersTableDataStore\.$/'
count: 1
path: ../../lib/WooCommerce/Helper.php
-
message: '/^Call to function method_exists\(\) with/'
count: 2
path: ../../lib/WooCommerce/Helper.php
-
message: '/^Call to an undefined method Codeception\\TestInterface::getName()./'
count: 1
path: ../../tests/_support/CheckSkippedTestsExtension.php
reportUnmatchedIgnoredErrors: true
dynamicConstantNames:
- MAILPOET_PREMIUM_INITIALIZED
doctrine:
objectManagerLoader: create-entity-manager.php
# exclude level 6 errors
checkMissingIterableValueType: false
excludePaths:
analyseAndScan:
- ../../lib/Config/PopulatorData/Templates # analysis of templates is extremely slow, let's skip them for now
- ../../tests/_support/_generated
- ../../tests/unit/Entities/SubscriberEntityTest.php
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php # does not yet offer support for PHP 8.1
includes:
- extensions/CodeceptionExtension/extension.neon
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-doctrine/rules.neon
- vendor/szepeviktor/phpstan-wordpress/extension.neon
- php-version-dependent-config.php # PHP version detection + configuraton dependent on PHP version
- phpstan-baseline-fix-lib.php # include baseline files