Notifier example

/** * @author Smaïne Milianni <smaine.milianni@gmail.com> */
final class NotifierTest extends TestCase
{
    public function testItThrowAnExplicitErrorIfAnSmsChannelDoesNotHaveRecipient()
    {
        $this->expectException(LogicException::class);
        $this->expectExceptionMessage('The "sms" channel needs a Recipient.');

        $notifier = new Notifier(['sms' => new SmsChannel(new NullTransport())]);
        $notifier->send(new Notification('Hello World!', ['sms/twilio']));
    }
}
'json' => [
                        'additionalData' => [
                            'shopwareVersion' => '6.4.12',
                            'language' => 'en',
                        ],
                        'instanceId' => '1234567890',
                        'event' => Notifier::EVENT_INSTALL_FINISHED,
                    ],
                ]
            );

        $notifier = new Notifier('http://localhost', $idGenerator$guzzle, '6.4.12');
        $notifier->doTrackEvent(Notifier::EVENT_INSTALL_FINISHED, ['language' => 'en']);
    }

    public function testTrackEventDoesNotThrowOnException(): void
    {
        $idGenerator = $this->createMock(UniqueIdGenerator::class);
        $idGenerator->expects(static::once())->method('getUniqueId')
            ->willReturn('1234567890');

        $guzzle = $this->createMock(Client::class);
        $guzzle->expects(static::once())->method('postAsync')
            
Home | Imprint | This part of the site doesn't use cookies.