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 13
13
use Magento \Framework \Event ;
14
14
use Magento \Framework \Event \Observer ;
15
15
use Magento \Framework \Indexer \IndexerInterface ;
16
+ use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
16
17
use PHPUnit \Framework \MockObject \MockObject ;
17
18
use PHPUnit \Framework \TestCase ;
18
19
@@ -53,6 +54,7 @@ class InvalidatePriceIndexUponConfigChangeObserverTest extends TestCase
53
54
*/
54
55
public function setUp ()
55
56
{
57
+ $ objectManager = new ObjectManager ($ this );
56
58
$ this ->priceIndexProcessorMock = $ this ->createMock (Processor::class);
57
59
$ this ->indexerMock = $ this ->getMockBuilder (IndexerInterface::class)
58
60
->getMockForAbstractClass ();
@@ -62,8 +64,11 @@ public function setUp()
62
64
->setMethods (['getChangedPaths ' ])
63
65
->getMock ();
64
66
65
- $ this ->observer = new InvalidatePriceIndexUponConfigChangeObserver (
66
- $ this ->priceIndexProcessorMock
67
+ $ this ->observer = $ objectManager ->getObject (
68
+ InvalidatePriceIndexUponConfigChangeObserver::class,
69
+ [
70
+ 'priceIndexProcessor ' => $ this ->priceIndexProcessorMock
71
+ ]
67
72
);
68
73
}
69
74
You can’t perform that action at this time.
0 commit comments