Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function testNewElection() |
||
10 | { |
||
11 | $winners = 2; |
||
12 | $candidateCount = 6; |
||
13 | |||
14 | $candidates = $ballots = []; |
||
15 | |||
16 | for ($i=1; $i <= $candidateCount; $i++) { |
||
17 | $candidates[$i] = new Candidate($i); |
||
18 | } |
||
19 | |||
20 | $ballots[] = new Ballot([4, 5, 6]); |
||
21 | $ballots[] = new Ballot([1, 2, 3]); |
||
22 | |||
23 | $election = new Election($winners, $candidates, $ballots); |
||
24 | |||
25 | $this->assertEquals($candidates[3], $election->getCandidate(3)); |
||
26 | $this->assertEquals($candidateCount, $election->getCandidateCount()); |
||
27 | $this->assertEquals($candidateCount, $election->getActiveCandidateCount()); |
||
28 | $this->assertEquals($winners, $election->getWinnersCount()); |
||
29 | } |
||
30 | } |
||
31 |