| Total Complexity | 2 | 
| Total Lines | 19 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 8 | class PHPEncryptionAdapterTest extends SapphireTest  | 
            ||
| 9 | { | 
            ||
| 10 | public function testEncryptAndDecrypt()  | 
            ||
| 11 |     { | 
            ||
| 12 | $adapter = new DefusePHPEncryptionAdapter();  | 
            ||
| 13 | |||
| 14 |         $cipher = $adapter->encrypt('Hello World', 'secretkey123'); | 
            ||
| 15 |         $this->assertNotEquals('Hello World', $cipher); | 
            ||
| 16 | |||
| 17 | $plaintext = $adapter->decrypt($cipher, 'secretkey123');  | 
            ||
| 18 |         $this->assertSame('Hello World', $plaintext); | 
            ||
| 19 | }  | 
            ||
| 20 | |||
| 21 | /**  | 
            ||
| 22 | * @expectedException \SilverStripe\MFA\Exception\EncryptionAdapterException  | 
            ||
| 23 | */  | 
            ||
| 24 | public function testExceptionThrownWhenDecryptionFails()  | 
            ||
| 27 | }  | 
            ||
| 28 | }  | 
            ||
| 29 |