![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/Api/Test/Unit/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\Api\Test\Unit; use Magento\Framework\Api\ObjectFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class AbstractSimpleObjectBuilderTest extends TestCase { /** * @var MockObject|ObjectFactory */ private $objectFactoryMock; /** * @var StubAbstractSimpleObjectBuilder */ private $stubSimpleObjectBuilder; protected function setUp(): void { $this->objectFactoryMock = $this->createMock(ObjectFactory::class); $this->stubSimpleObjectBuilder = new StubAbstractSimpleObjectBuilder($this->objectFactoryMock); } public function testCreate() { $stubSimpleObjectMock = $this->createMock(StubAbstractSimpleObject::class); $this->objectFactoryMock->expects($this->once()) ->method('create') ->with(StubAbstractSimpleObject::class, ['data' => []]) ->willReturn($stubSimpleObjectMock); $object = $this->stubSimpleObjectBuilder->create(); $this->assertInstanceOf(StubAbstractSimpleObject::class, $object); } }