-
Notifications
You must be signed in to change notification settings - Fork 190
/
MachineTokenCommandTest.php
51 lines (39 loc) · 1.22 KB
/
MachineTokenCommandTest.php
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
<?php
/**
* @file
* Contains Pantheon\Terminus\UnitTests\Commands\Auth\MachineTokenCommandTest
*/
namespace Pantheon\Terminus\UnitTests\Commands\Auth;
use Pantheon\Terminus\Session\Session;
use Psr\Log\NullLogger;
use Terminus\Collections\MachineTokens;
use Terminus\Models\User;
abstract class MachineTokenCommandTest extends \PHPUnit_Framework_TestCase {
protected $session;
protected $machine_tokens;
protected $user;
protected $logger;
protected $command;
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->machine_tokens = $this->getMockBuilder(MachineTokens::class)
->disableOriginalConstructor()
->getMock();
$this->user = $this->getMockBuilder(User::class)
->disableOriginalConstructor()
->getMock();
$this->user->machine_tokens = $this->machine_tokens;
$this->session = $this->getMockBuilder(Session::class)
->disableOriginalConstructor()
->getMock();
$this->session->method('getUser')
->willReturn($this->user);
$this->logger = $this->getMockBuilder(NullLogger::class)
->setMethods(array('log'))
->getMock();
}
}