![]() 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/module-sales/Test/Unit/Model/Config/Source/Order/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Sales\Test\Unit\Model\Config\Source\Order; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Sales\Model\Config\Source\Order\Status; use Magento\Sales\Model\Order\Config; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class StatusTest extends TestCase { /** @var Status */ protected $object; /** @var ObjectManager */ protected $objectManager; /** @var Config|MockObject */ protected $config; protected function setUp(): void { $this->config = $this->createMock(Config::class); $this->objectManager = new ObjectManager($this); $this->object = $this->objectManager->getObject( Status::class, ['orderConfig' => $this->config] ); } public function testToOptionArray() { $this->config->expects($this->once())->method('getStateStatuses') ->willReturn(['status1', 'status2']); $this->assertEquals( [ ['value' => '', 'label' => '-- Please Select --'], ['value' => 0, 'label' => 'status1'], ['value' => 1, 'label' => 'status2'], ], $this->object->toOptionArray() ); } }