PHP Classes

File: tests/Transformation/GenericTransfomationCase.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Cipher Sweet   tests/Transformation/GenericTransfomationCase.php   Download  
File: tests/Transformation/GenericTransfomationCase.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Cipher Sweet
Encrypt data in away that can be searched
Author: By
Last change:
Date: 6 years ago
Size: 879 bytes
 

Contents

Class file image Download
<?php
namespace ParagonIE\CipherSweet\Tests\Transformation;

use
ParagonIE\CipherSweet\Contract\TransformationInterface;
use
PHPUnit\Framework\TestCase;

/**
 * Class GenericTransfomationCase
 * @package ParagonIE\CipherSweet\Tests\Transformation
 */
abstract class GenericTransfomationCase extends TestCase
{
   
/**
     * @return TransformationInterface
     */
   
abstract protected function getTransformation();

   
/**
     * @return array<int, array<int, string>>
     */
   
abstract protected function getTestCases();

    public function
testHappyPath()
    {
       
$tf = $this->getTransformation();
       
$testCases = $this->getTestCases();
        foreach (
$testCases as $i => $testCase) {
            list (
$input, $expected) = $testCase;
           
$this->assertEquals(
               
$expected,
               
$tf($input)
            );
        }
    }
}