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

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -