@@ 34-76 (lines=43) @@ | ||
31 | * Class AbstractStorageMessageTest |
|
32 | * @author Gabriel Somoza <[email protected]> |
|
33 | */ |
|
34 | class AbstractStorageMessageTest extends BaseTestCase |
|
35 | { |
|
36 | /** @var m\Mock|AbstractStorageMessage */ |
|
37 | protected $instance; |
|
38 | ||
39 | /** |
|
40 | * @inheritDoc |
|
41 | */ |
|
42 | protected function setUp() |
|
43 | { |
|
44 | $this->instance = m::mock(AbstractStorageMessage::class)->makePartial(); |
|
45 | } |
|
46 | ||
47 | /** |
|
48 | * testConstructor |
|
49 | */ |
|
50 | public function testConstructor() |
|
51 | { |
|
52 | $this->assertInstanceOf(AbstractMessage::class, $this->instance); |
|
53 | $this->assertInstanceOf(StorageAwareInterface::class, $this->instance); |
|
54 | $this->assertInstanceOf(ComparatorAwareInterface::class, $this->instance); |
|
55 | } |
|
56 | ||
57 | /** |
|
58 | * testGetSetStorage |
|
59 | */ |
|
60 | public function testGetSetStorage() |
|
61 | { |
|
62 | $storage = m::mock(StorageInterface::class); |
|
63 | $this->instance->setStorage($storage); |
|
64 | $this->assertSame($storage, $this->instance->getStorage()); |
|
65 | } |
|
66 | ||
67 | /** |
|
68 | * testGetSetComparator |
|
69 | */ |
|
70 | public function testGetSetComparator() |
|
71 | { |
|
72 | $comparator = function(){}; |
|
73 | $this->instance->setComparator($comparator); |
|
74 | $this->assertSame($comparator, $this->instance->getComparator()); |
|
75 | } |
|
76 | } |
|
77 |
@@ 35-77 (lines=43) @@ | ||
32 | * Class AbstractTimelineMessageTest |
|
33 | * @author Gabriel Somoza <[email protected]> |
|
34 | */ |
|
35 | 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 |