Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PatchFactoryTest.php
Go to the documentation of this file.
1 <?php
8 
16 
21 class PatchFactoryTest extends \PHPUnit\Framework\TestCase
22 {
26  private $patchFactory;
27 
31  private $objectManagerMock;
32 
33  protected function setUp()
34  {
35  $objectManager = new ObjectManager($this);
36  $this->objectManagerMock = $this->createMock(ObjectManagerInterface::class);
37  $this->patchFactory = $objectManager->getObject(
38  PatchFactory::class,
39  [
40  'objectManager' => $this->objectManagerMock,
41  ]
42  );
43  }
44 
49  public function testCreateNonPatchInterface()
50  {
51  $patchNonPatchInterface = $this->createMock(\stdClass::class);
52  $this->objectManagerMock->expects($this->any())
53  ->method('create')
54  ->with('\\stdClass')
55  ->willReturn($patchNonPatchInterface);
56 
57  $this->patchFactory->create(\stdClass::class);
58  }
59 }
$objectManager
Definition: bootstrap.php:17