File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/code/Magento/CatalogInventory/Test/Unit/Observer Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1313use Magento \Framework \Event ;
1414use Magento \Framework \Event \Observer ;
1515use Magento \Framework \Indexer \IndexerInterface ;
16+ use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
1617use PHPUnit \Framework \MockObject \MockObject ;
1718use PHPUnit \Framework \TestCase ;
1819
@@ -53,6 +54,7 @@ class InvalidatePriceIndexUponConfigChangeObserverTest extends TestCase
5354 */
5455 public function setUp ()
5556 {
57+ $ objectManager = new ObjectManager ($ this );
5658 $ this ->priceIndexProcessorMock = $ this ->createMock (Processor::class);
5759 $ this ->indexerMock = $ this ->getMockBuilder (IndexerInterface::class)
5860 ->getMockForAbstractClass ();
@@ -62,8 +64,11 @@ public function setUp()
6264 ->setMethods (['getChangedPaths ' ])
6365 ->getMock ();
6466
65- $ this ->observer = new InvalidatePriceIndexUponConfigChangeObserver (
66- $ this ->priceIndexProcessorMock
67+ $ this ->observer = $ objectManager ->getObject (
68+ InvalidatePriceIndexUponConfigChangeObserver::class,
69+ [
70+ 'priceIndexProcessor ' => $ this ->priceIndexProcessorMock
71+ ]
6772 );
6873 }
6974
You can’t perform that action at this time.
0 commit comments