1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
*/
namespace Temando\Shipping\Controller\Adminhtml\Dispatch;
use Magento\Framework\Session\SessionManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\TestCase\AbstractBackendController;
use Temando\Shipping\Rest\AuthenticationInterface;
/**
* @magentoAppArea adminhtml
*/
class NewActionTest extends AbstractBackendController
{
/**
* The resource used to authorize action
*
* @var string
*/
protected $resource = 'Temando_Shipping::dispatches';
/**
* The uri at which to access the controller
*
* @var string
*/
protected $uri = 'backend/temando/dispatch/new';
protected function setUp()
{
parent::setUp();
/** @var SessionManagerInterface $adminSession */
$adminSession = Bootstrap::getObjectManager()->get(SessionManagerInterface::class);
$adminSession->setData(AuthenticationInterface::DATA_KEY_SESSION_TOKEN_EXPIRY, '2038-01-19T03:03:33.000Z');
}
/**
* @test
* @magentoConfigFixture default/carriers/temando/account_id 23
* @magentoConfigFixture default/carriers/temando/bearer_token 808
*/
public function pageIsRendered()
{
$this->dispatch($this->uri);
$this->assertContains('DispatchCreate', $this->getResponse()->getBody());
}
/**
* @test
* @magentoConfigFixture default/carriers/temando/account_id 23
* @magentoConfigFixture default/carriers/temando/bearer_token 808
*/
public function testAclHasAccess()
{
parent::testAclHasAccess();
}
/**
* @test
* @magentoConfigFixture default/carriers/temando/account_id 23
* @magentoConfigFixture default/carriers/temando/bearer_token 808
*/
public function testAclNoAccess()
{
parent::testAclNoAccess();
}
}