phpunit - Magento 2 dependency injection preferences in unit tests -
i wondering why dependency injection preferences specified in di.xml not being read magento\testframework\helper\bootstrap
provided magento. have found workaround providing direct configuration setup it:
bootstrap::getobjectmanager()->configure( [ 'preferences' => [ 'example\coreinterface' => 'example\core' ] ] );
unfortunately it's not di.xml rewrite prone, 1 day rewrite di.xml preference , break tests. nice load di.xml upon bootstrap of tests. there better way of loading interface preference rewrites?
Comments
Post a Comment