PHP Classes

File: test/Picamator/SteganographyKit/SecretText/PlainTextTest.php

Recommend this page to a friend!
  Classes of Sergii Pryz   PHP Steganography Kit   test/Picamator/SteganographyKit/SecretText/PlainTextTest.php   Download  
File: test/Picamator/SteganographyKit/SecretText/PlainTextTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP Steganography Kit
Library of algorithms to encode messages in images
Author: By
Last change:
Date: 9 years ago
Size: 1,928 bytes
 

Contents

Class file image Download
<?php
/**
 * Base SteganographyKit UnitTest
 *
 * @link https://github.com/picamator/SteganographyKit
 * @license http://opensource.org/licenses/BSD-3-Clause New BSD License
 */

use Picamator\SteganographyKit\SecretText\PlainText;

class
PlainTextTest extends BaseTest
{
   
/**
     * @dataProvider providerGetBinaryData
     * @param string $text
     * @param string $expected
     */
   
public function testGetBinaryData($text, $expected)
    {
       
$plainText = new PlainText(array('text' => $text));
       
$actual = $plainText->getBinaryData();
       
       
$this->assertEquals($expected, $actual);
    }
   
   
/**
     * @dataProvider providerGetFromBinaryData
     * @param string $binaryData
     * @param string $expected
     */
   
public function testGetFromBinaryData($binaryData, $expected)
    {
       
$plainText = new PlainText();
       
$actual = $plainText->getFromBinaryData($binaryData);
       
       
$this->assertEquals($expected, $actual);
    }
   
    public function
providerGetBinaryData()
    {
        return array(
            array(
               
'Lorem ipsum',
               
'01100101010010100111101001111010011110010101001100111001010010110111101001010110010110000100100101001100010000110110011101110101011110100101000101010101010000010100011101010001011000110100010101010100011001110011110100111101'
               
. PlainText::END_TEXT_MARK
           
)
        );
    }
   
    public function
providerGetFromBinaryData()
    {
        return array(
            array(
               
'01100101010010100111101001111010011110010101001100111001010010110111101001010110010110000100100101001100010000110110011101110101011110100101000101010101010000010100011101010001011000110100010101010100011001110011110100111101'
               
. PlainText::END_TEXT_MARK,
               
'Lorem ipsum'
           
)
        );
    }
}