![]() 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/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Model\Order; use Magento\TestFramework\Helper\Bootstrap; class AddressTest extends \PHPUnit\Framework\TestCase { /** @var Address */ protected $_model; protected function setUp(): void { $this->_model = Bootstrap::getObjectManager()->create(\Magento\Sales\Model\Order\Address::class); } /** * @magentoDataFixture Magento/Sales/_files/order.php * @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/Customer/_files/customer_address.php */ public function testSave() { /** @var \Magento\Sales\Model\Order $order */ $order = Bootstrap::getObjectManager()->create(\Magento\Sales\Model\Order::class); $order->loadByIncrementId('100000001'); $this->_model->setOrder($order); $this->_model->setEmail('[email protected]'); $this->_model->setPostcode('12345'); $this->_model->setLastname('LastName'); $this->_model->setStreet('Street'); $this->_model->setCity('City'); $this->_model->setTelephone('123-45-67'); $this->_model->setCountryId(1); $this->_model->setFirstname('FirstName'); $this->_model->setAddressType('billing'); $this->_model->setRegionId(1); $this->_model->save(); $this->assertEquals($order->getId(), $this->_model->getParentId()); } }