@@ -15,14 +15,11 @@ public function testCanEncryptInBasicMode():void
1515 $ data = 'encryptionprocess ' ;
1616 $ key = 'thekey ' ;
1717
18- $ encrypted = VigenereCipher::encrypt ($ data , $ key , VigenereMode::BASIC ->value );
18+ $ encrypted = ( string ) VigenereCipher::encrypt ($ data , $ key , VigenereMode::BASIC ->value );
1919
2020 $ this ->assertEquals (strlen ($ data ), strlen ($ encrypted ));
2121 $ this ->assertEquals ('xugbcnmpsxtphjicw ' , $ encrypted );
2222 $ this ->assertNotEquals ($ data , $ encrypted );
23- $ this ->assertIsString ($ data );
24- $ this ->assertIsString ($ key );
25- $ this ->assertIsString ($ encrypted );
2623 $ this ->assertMatchesRegularExpression ($ allowedChars , $ data );
2724 $ this ->assertMatchesRegularExpression ($ allowedChars , $ key );
2825 $ this ->assertMatchesRegularExpression ($ allowedChars , $ encrypted );
@@ -35,7 +32,7 @@ public function testCanNotEncryptInBasicModeWithInvalidKey():void
3532
3633 $ encrypted = VigenereCipher::encrypt ($ data , $ key , VigenereMode::BASIC ->value );
3734
38- $ this ->assertNull ( $ encrypted );
35+ $ this ->assertEquals ( '' , $ encrypted );
3936 }
4037
4138 public function testCanDecryptInBasicMode ():void
@@ -44,14 +41,11 @@ public function testCanDecryptInBasicMode():void
4441 $ data = 'xugbcnmpsxtphjicw ' ;
4542 $ key = 'thekey ' ;
4643
47- $ decrypted = VigenereCipher::decrypt ($ data , $ key , VigenereMode::BASIC ->value );
44+ $ decrypted = ( string ) VigenereCipher::decrypt ($ data , $ key , VigenereMode::BASIC ->value );
4845
4946 $ this ->assertEquals (strlen ($ data ), strlen ($ decrypted ));
5047 $ this ->assertEquals ('encryptionprocess ' , $ decrypted );
5148 $ this ->assertNotEquals ($ data , $ decrypted );
52- $ this ->assertIsString ($ data );
53- $ this ->assertIsString ($ key );
54- $ this ->assertIsString ($ decrypted );
5549 $ this ->assertMatchesRegularExpression ($ allowedChars , $ data );
5650 $ this ->assertMatchesRegularExpression ($ allowedChars , $ key );
5751 $ this ->assertMatchesRegularExpression ($ allowedChars , $ decrypted );
@@ -64,7 +58,7 @@ public function testCanNotDecryptInBasicModeWithInvalidKey():void
6458
6559 $ encrypted = VigenereCipher::decrypt ($ data , $ key , VigenereMode::BASIC ->value );
6660
67- $ this ->assertNull ( $ encrypted );
61+ $ this ->assertEquals ( '' , $ encrypted );
6862 }
6963
7064 public function testCanEncryptInAlphaNumericMode ():void
@@ -78,9 +72,6 @@ public function testCanEncryptInAlphaNumericMode():void
7872 $ this ->assertEquals (strlen ($ data ), strlen ($ encrypted ));
7973 $ this ->assertEquals ('Xu5B2NMpTxjPHJWCz ' , $ encrypted );
8074 $ this ->assertNotEquals ($ data , $ encrypted );
81- $ this ->assertIsString ($ data );
82- $ this ->assertIsString ($ key );
83- $ this ->assertIsString ($ encrypted );
8475 $ this ->assertMatchesRegularExpression ($ allowedChars , $ data );
8576 $ this ->assertMatchesRegularExpression ($ allowedChars , $ key );
8677 $ this ->assertMatchesRegularExpression ($ allowedChars , $ encrypted );
@@ -93,7 +84,7 @@ public function testCanNotEncryptInAlphaNumericModeWithInvalidKey():void
9384
9485 $ encrypted = VigenereCipher::encrypt ($ data , $ key , VigenereMode::ALPHA_NUMERIC ->value );
9586
96- $ this ->assertNull ( $ encrypted );
87+ $ this ->assertEquals ( '' , $ encrypted );
9788 }
9889
9990 public function testCanDecryptWithAlphaNumericMode ():void
@@ -107,9 +98,6 @@ public function testCanDecryptWithAlphaNumericMode():void
10798 $ this ->assertEquals (strlen ($ data ), strlen ($ decrypted ));
10899 $ this ->assertEquals ('Encrypti0nProC3s5 ' , $ decrypted );
109100 $ this ->assertNotEquals ($ data , $ decrypted );
110- $ this ->assertIsString ($ data );
111- $ this ->assertIsString ($ key );
112- $ this ->assertIsString ($ decrypted );
113101 $ this ->assertMatchesRegularExpression ($ allowedChars , $ data );
114102 $ this ->assertMatchesRegularExpression ($ allowedChars , $ key );
115103 $ this ->assertMatchesRegularExpression ($ allowedChars , $ decrypted );
@@ -122,7 +110,7 @@ public function testCanNotDecryptInAlphaNumericModeWithInvalidKey():void
122110
123111 $ encrypted = VigenereCipher::decrypt ($ data , $ key , VigenereMode::ALPHA_NUMERIC ->value );
124112
125- $ this ->assertNull ( $ encrypted );
113+ $ this ->assertEquals ( '' , $ encrypted );
126114 }
127115
128116 public function testCanGetBasicVigenereClass (): void
@@ -132,7 +120,6 @@ public function testCanGetBasicVigenereClass(): void
132120
133121 $ className = VigenereCipher::getClassName ($ mode );
134122
135- $ this ->assertIsString ($ className );
136123 $ this ->assertEquals ($ path . 'BasicVigenereCipher ' , $ className );
137124 }
138125
@@ -143,7 +130,6 @@ public function testCanGetAlphaNumericVigenereClass(): void
143130
144131 $ className = VigenereCipher::getClassName ($ mode );
145132
146- $ this ->assertIsString ($ className );
147133 $ this ->assertEquals ($ path . 'AlnumVigenereCipher ' , $ className );
148134 }
149135}
0 commit comments