setPersonTypeId(2); $event = $this->createMock(\Bitrix\Main\Event::class); $event->method('getParameter')->willReturn($order); $spy = \Mockery::spy('overload:' .RetailCrmEvent::class); EventsHandlers::$disableSaleHandler = true; EventsHandlers::OnSaleOrderSavedHandler($event); $spy->shouldNotHaveReceived('orderSave'); self::assertTrue(true); } }