Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
order_status.php
Go to the documentation of this file.
1 <?php
8 $status = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Sales\Model\Order\Status::class);
9 //status for state new
10 $status->setData('status', 'custom_new_status')->setData('label', 'Test Status')->save();
11 $status->assignState(\Magento\Sales\Model\Order::STATE_NEW, true);
12 //status for state canceled
13 $status->setData('status', 'custom_canceled_status')->setData('label', 'Test Status')->unsetData('id')->save();
14 $status->assignState(\Magento\Sales\Model\Order::STATE_CANCELED, true);
$status
Definition: order_status.php:8