-
Notifications
You must be signed in to change notification settings - Fork 45
/
EventSpec.php
38 lines (31 loc) · 911 Bytes
/
EventSpec.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
<?php
namespace spec\League\Event;
use League\Event\Emitter;
use PhpSpec\ObjectBehavior;
class EventSpec extends ObjectBehavior
{
public function let()
{
$this->beConstructedWith('name');
}
public function it_is_initializable()
{
$this->shouldHaveType('League\Event\Event');
$this->shouldHaveType('League\Event\AbstractEvent');
$this->shouldHaveType('League\Event\EventInterface');
}
public function it_should_have_a_name()
{
$this->getName()->shouldReturn('name');
}
public function it_should_allow_propagation_to_be_stopped()
{
$this->stopPropagation()->shouldReturn($this);
$this->isPropagationStopped()->shouldReturn(true);
}
public function it_should_expose_an_emitter(Emitter $emitter)
{
$this->setEmitter($emitter);
$this->getEmitter()->shouldReturn($emitter);
}
}