logger = $this->createMock(Logger::class); $integrationHelper = $this->createMock(IntegrationHelper::class); $configuration = new Configuration($integrationHelper); $this->twilioTransport = new TwilioTransport($configuration, $this->logger); } public function testSendSMS(): void { $lead = new Lead(); $lead->setMobile('123456'); $this->logger->expects($this->once()) ->method('warning') ->with('mautic.sms.transport.twilio.not_configured'); $this->twilioTransport->sendSms($lead, 'some_content'); } public function testCreatePayload(): void { $reflection = new \ReflectionClass($this->twilioTransport::class); $method = $reflection->getMethod('createPayload'); $method->setAccessible(true); $payload = ['messagingServiceSid' => 'MS1234', 'body' => 'some_content']; $result = $method->invokeArgs($this->twilioTransport, array_values($payload)); Assert::assertSame($payload, $result); } }