@@ -36,7 +36,7 @@ class HashTableTest extends TestCase {
3636 /**
3737 * tests adding new elements to the map
3838 */
39- public function testAddition () {
39+ public function testAddition (): void {
4040 $ class = stdClass::class;
4141 $ hashMap = new HashTable ();
4242 $ boolean = $ hashMap ->add (1 , $ class );
@@ -45,7 +45,7 @@ public function testAddition() {
4545 $ this ->assertTrue (null !== $ has );
4646 }
4747
48- public function testSize () {
48+ public function testSize (): void {
4949 $ class = stdClass::class;
5050 $ hashMap = new HashTable ();
5151 $ hashMap ->add (1 , $ class );
@@ -60,7 +60,7 @@ public function testSize() {
6060 /**
6161 * tests querying the map for a value
6262 */
63- public function testContains () {
63+ public function testContains (): void {
6464 $ class = stdClass::class;
6565 $ hashMap = new HashTable ();
6666 $ hashMap ->add (1 , $ class );
@@ -71,7 +71,7 @@ public function testContains() {
7171 /**
7272 * tests retrieving a node from the map
7373 */
74- public function testGetNodeByValue () {
74+ public function testGetNodeByValue (): void {
7575 $ class = stdClass::class;
7676 $ hashMap = new HashTable ();
7777 $ hashMap ->add (1 , $ class );
@@ -82,23 +82,53 @@ public function testGetNodeByValue() {
8282 /**
8383 * tests removing a value from the map
8484 */
85- public function testRemove () {
85+ public function testRemove (): void {
8686 $ hashTable = new HashTable ();
87- $ hashTable ->put ("about " , new class {});
88- $ hashTable ->put ("account " , new class {});
89- $ hashTable ->put ("apps " , new class {});
90- $ hashTable ->put ("calorie_tracker " , new class {});
91- $ hashTable ->put ("tnc " , new class {});
92- $ hashTable ->put ("forgot_password " , new class {});
93- $ hashTable ->put ("general_api " , new class {});
94- $ hashTable ->put ("install " , new class {});
95- $ hashTable ->put ("login " , new class {});
96- $ hashTable ->put ("logout " , new class {});
97- $ hashTable ->put ("maintenance " , new class {});
98- $ hashTable ->put ("password_manager " , new class {});
99- $ hashTable ->put ("promotion " , new class {});
100- $ hashTable ->put ("register " , new class {});
101- $ hashTable ->put ("users " , new class {});
87+ $ hashTable ->put ("about " , new class {
88+
89+ });
90+ $ hashTable ->put ("account " , new class {
91+
92+ });
93+ $ hashTable ->put ("apps " , new class {
94+
95+ });
96+ $ hashTable ->put ("calorie_tracker " , new class {
97+
98+ });
99+ $ hashTable ->put ("tnc " , new class {
100+
101+ });
102+ $ hashTable ->put ("forgot_password " , new class {
103+
104+ });
105+ $ hashTable ->put ("general_api " , new class {
106+
107+ });
108+ $ hashTable ->put ("install " , new class {
109+
110+ });
111+ $ hashTable ->put ("login " , new class {
112+
113+ });
114+ $ hashTable ->put ("logout " , new class {
115+
116+ });
117+ $ hashTable ->put ("maintenance " , new class {
118+
119+ });
120+ $ hashTable ->put ("password_manager " , new class {
121+
122+ });
123+ $ hashTable ->put ("promotion " , new class {
124+
125+ });
126+ $ hashTable ->put ("register " , new class {
127+
128+ });
129+ $ hashTable ->put ("users " , new class {
130+
131+ });
102132 $ this ->assertTrue (null !== $ hashTable ->get ("calorie_tracker " ));
103133 $ hashTable ->remove ("calorie_tracker " );
104134 $ this ->assertTrue (null === $ hashTable ->get ("calorie_tracker " ));
@@ -107,7 +137,7 @@ public function testRemove() {
107137 /**
108138 * tests adding different key types to the map
109139 */
110- public function testKeyTypes () {
140+ public function testKeyTypes (): void {
111141 $ hashMap = new HashTable ();
112142 $ added = $ hashMap ->add (new stdClass (), "stdClass " );
113143 $ this ->assertTrue ($ added );
@@ -116,21 +146,21 @@ public function testKeyTypes() {
116146 /**
117147 * tests retrieving all keys from the map
118148 */
119- public function testKeySet () {
149+ public function testKeySet (): void {
120150 $ hashMap = HashTableUtil::getHashTable (10 );
121151 $ keySet = $ hashMap ->keySet ();
122152 $ this ->assertTrue (count ($ keySet ) == 10 );
123153 }
124154
125- public function testClosure () {
155+ public function testClosure (): void {
126156 $ hashMap = new HashTable ();
127157 $ added = $ hashMap ->add ("test " , function () {
128158 return new stdClass ();
129159 });
130160 $ this ->assertTrue ($ added );
131161 $ added = $ hashMap ->add ("test2 " , new class {
132162
133- public function x () {
163+ public function x (): void {
134164 }
135165
136166 });
0 commit comments