File: test/unit/Structure/NodeTest.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  Halite  >  test/unit/Structure/NodeTest.php  >  Download  
File: test/unit/Structure/NodeTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Halite
Perform cryptography operations with libsodium
Author: By
Last change:
Date: 5 years ago
Size: 469 bytes
 

Contents

Class file image Download
<?php

use \ParagonIE\Halite\Structure\Node;

/**
 * @backupGlobals disabled
 * @backupStaticAttributes disabled
 */
class NodeTest extends PHPUnit_Framework_TestCase
{
    public function
testHash()
    {
       
$stringData = \random_bytes(32);
       
$hash = \Sodium\crypto_generichash($stringData);
       
$node = new Node($stringData);

       
$this->assertEquals($stringData, $node->getData());
       
$this->assertEquals($hash, $node->getHash(true));
    }
}


For more information send a message to info at phpclasses dot org.