1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
4
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
5
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
6
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
7
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
9
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
10
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
11
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
12
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
13
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14
|
|
|
* |
15
|
|
|
* This software consists of voluntary contributions made by many individuals |
16
|
|
|
* and is licensed under the MIT license. For more information, see |
17
|
|
|
* <http://www.doctrine-project.org>. |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
namespace BaleenTest\Cli\CommandBus\Timeline; |
21
|
|
|
|
22
|
|
|
use Baleen\Cli\CommandBus\AbstractMessage; |
23
|
|
|
use Baleen\Cli\CommandBus\Timeline\AbstractTimelineCommand; |
24
|
|
|
use Baleen\Cli\CommandBus\Util\StorageAwareInterface; |
25
|
|
|
use Baleen\Cli\CommandBus\Util\TimelineAwareInterface; |
26
|
|
|
use Baleen\Migrations\Storage\StorageInterface; |
27
|
|
|
use Baleen\Migrations\Timeline; |
28
|
|
|
use BaleenTest\Cli\BaseTestCase; |
29
|
|
|
use Mockery as m; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Class AbstractTimelineMessageTest |
33
|
|
|
* @author Gabriel Somoza <[email protected]> |
34
|
|
|
*/ |
35
|
|
View Code Duplication |
class AbstractTimelineMessageTest extends BaseTestCase |
36
|
|
|
{ |
37
|
|
|
/** @var m\Mock|AbstractTimelineCommand */ |
38
|
|
|
protected $instance; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* setUp |
42
|
|
|
*/ |
43
|
|
|
public function setUp() |
44
|
|
|
{ |
45
|
|
|
$this->instance = m::mock(AbstractTimelineCommand::class)->makePartial(); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* testConstructor |
50
|
|
|
*/ |
51
|
|
|
public function testConstructor() |
52
|
|
|
{ |
53
|
|
|
$this->assertInstanceOf(AbstractMessage::class, $this->instance); |
54
|
|
|
$this->assertInstanceOf(StorageAwareInterface::class, $this->instance); |
55
|
|
|
$this->assertInstanceOf(TimelineAwareInterface::class, $this->instance); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* testGetSetStorage |
60
|
|
|
*/ |
61
|
|
|
public function testGetSetStorage() |
62
|
|
|
{ |
63
|
|
|
$storage = m::mock(StorageInterface::class); |
64
|
|
|
$this->instance->setStorage($storage); |
65
|
|
|
$this->assertSame($storage, $this->instance->getStorage()); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* testGetSetTimeline |
70
|
|
|
*/ |
71
|
|
|
public function testGetSetTimeline() |
72
|
|
|
{ |
73
|
|
|
$timeline = m::mock(Timeline::class); |
74
|
|
|
$this->instance->setTimeline($timeline); |
75
|
|
|
$this->assertSame($timeline, $this->instance->getTimeline()); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|