I have create a observer for sales_order_load_after event, and now creating unit test case for this method but not identifying on code coverage.

one of the execute method created like

public function execute(Observer $observer)
$order = $observer->getOrder();
$extensionAttributes = $order->getExtensionAttributes();

if ($extensionAttributes === null) {
    $extensionAttributes = $this->getOrderExtensionDependency();

$test_number = $this->CustomorderFactory->create()->load($order->getId(), 'order_id');
$attribute = $test_number->getData('test_number');
if (empty($attribute)) {
    $attribute = "null";

Now wanted to create a unit test code coverage for this, can someone please


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy