Skip to content

Commit f9cf188

Browse files
committed
Adding ObjectManager usage
1 parent d34a54c commit f9cf188

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/code/Magento/Bundle/Test/Unit/Observer/SetAttributeTabBlockObserverTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Catalog\Model\Product\Type;
1515
use Magento\Framework\Event;
1616
use Magento\Framework\Event\Observer;
17+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1718
use PHPUnit\Framework\MockObject\MockObject;
1819
use PHPUnit\Framework\TestCase;
1920

@@ -54,6 +55,7 @@ class SetAttributeTabBlockObserverTest extends TestCase
5455
*/
5556
public function setUp()
5657
{
58+
$objectManager = new ObjectManager($this);
5759
$this->helperCatalogMock = $this->createMock(Catalog::class);
5860
$this->observerMock = $this->createMock(Observer::class);
5961
$this->eventMock = $this->getMockBuilder(Event::class)
@@ -64,8 +66,11 @@ public function setUp()
6466
->disableOriginalConstructor()
6567
->getMock();
6668

67-
$this->observer = new SetAttributeTabBlockObserver(
68-
$this->helperCatalogMock
69+
$this->observer = $objectManager->getObject(
70+
SetAttributeTabBlockObserver::class,
71+
[
72+
'helperCatalog' => $this->helperCatalogMock
73+
]
6974
);
7075
}
7176

0 commit comments

Comments
 (0)