File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PHPUnit \Framework \TestCase ;
4+
5+ require_once __DIR__ . '/../../www/includes/easyparliament/house.php ' ;
6+
7+ class HouseTest extends TestCase {
8+
9+ public function test_representatives_constant_is_1 (): void {
10+ $ this ->assertSame (1 , HOUSE ::REPRESENTATIVES );
11+ }
12+
13+ public function test_senate_constant_is_2 (): void {
14+ $ this ->assertSame (2 , HOUSE ::SENATE );
15+ }
16+
17+ public function test_pretty_name_for_representatives (): void {
18+ $ this ->assertSame ('Representatives ' , HOUSE ::pretty_name (HOUSE ::REPRESENTATIVES ));
19+ }
20+
21+ public function test_pretty_name_for_senate (): void {
22+ $ this ->assertSame ('Senators ' , HOUSE ::pretty_name (HOUSE ::SENATE ));
23+ }
24+
25+ public function test_pretty_name_returns_empty_string_for_invalid_house (): void {
26+ $ this ->assertSame ('' , HOUSE ::pretty_name (99 ));
27+ }
28+
29+ public function test_pretty_name_uses_default_house_when_primary_invalid (): void {
30+ $ this ->assertSame ('Senators ' , HOUSE ::pretty_name (99 , HOUSE ::SENATE ));
31+ }
32+
33+ public function test_pretty_name_returns_empty_when_both_invalid (): void {
34+ $ this ->assertSame ('' , HOUSE ::pretty_name (99 , 77 ));
35+ }
36+
37+ public function test_pretty_name_ignores_default_when_primary_valid (): void {
38+ $ this ->assertSame ('Representatives ' , HOUSE ::pretty_name (HOUSE ::REPRESENTATIVES , HOUSE ::SENATE ));
39+ }
40+
41+ }
You can’t perform that action at this time.
0 commit comments