SmsFrameworkPushedDeliveryReportTest.php in SMS Framework 8
File
tests/src/Kernel/SmsFrameworkPushedDeliveryReportTest.php
View source
<?php
namespace Drupal\Tests\sms\Kernel;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
class SmsFrameworkPushedDeliveryReportTest extends SmsFrameworkKernelBase {
public static $modules = [
'system',
'sms',
'entity_test',
'user',
'field',
'telephone',
'dynamic_entity_reference',
'sms_test_gateway',
];
protected $routeProvider;
protected function setUp() {
parent::setUp();
$this->routeProvider = $this->container
->get('router.route_provider');
}
public function testDeliveryReportRoute() {
$gateway = $this
->createMemoryGateway();
$name = 'sms.delivery_report.receive.' . $gateway
->id();
$route = $this->routeProvider
->getRouteByName($name);
$this
->assertEquals($gateway
->getPushReportPath(), $route
->getPath());
}
public function testDeliveryReportRouteNoSupportPush() {
$gateway = $this
->createMemoryGateway([
'plugin' => 'capabilities_default',
]);
$this
->setExpectedException(RouteNotFoundException::class);
$route = 'sms.delivery_report.receive.' . $gateway
->id();
$this->routeProvider
->getRouteByName($route);
}
}