/**
  * @covers CodeCollab\Encryption\Defusev2\Decryptor::__construct
  * @covers CodeCollab\Encryption\Defusev2\Decryptor::decrypt
  */
 public function testDecryptThrowsOnBadKey()
 {
     $encryptor = new Encryptor((new Key())->generate());
     $decryptor = new Decryptor((new Key())->generate());
     $this->expectException(FraudException::class);
     $decryptor->decrypt($encryptor->encrypt('foobar'));
 }
 /**
  * @covers CodeCollab\Encryption\Defusev2\Encryptor::__construct
  * @covers CodeCollab\Encryption\Defusev2\Encryptor::encrypt
  */
 public function testEncryptSuccess()
 {
     $encryptor = new Encryptor(DefuseKey::createNewRandomKey()->saveToAsciiSafeString());
     $this->assertSame(186, strlen($encryptor->encrypt('foobarbaz')));
 }