Completed
Pull Request — master (#11)
by adev
04:33
created

PriorityQueueSpec   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_enforces_predictable_queue_order_for_elements_with_the_same_priority() 0 10 1
1
<?php
2
3
namespace spec\Port\Steps;
4
5
use PhpSpec\ObjectBehavior;
6
7
class PriorityQueueSpec extends ObjectBehavior
8
{
9
    function it_is_initializable()
10
    {
11
        $this->shouldHaveType('Port\Steps\PriorityQueue');
12
    }
13
14
    function it_enforces_predictable_queue_order_for_elements_with_the_same_priority()
15
    {
16
        $this->insert('value_foo', 1);
17
        $this->insert('value_bar', 1);
18
        $this->insert('value_baz', 1);
19
20
        $this->extract()->shouldBe('value_foo');
21
        $this->extract()->shouldBe('value_bar');
22
        $this->extract()->shouldBe('value_baz');
23
    }
24
}
25