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