PHP Classes
elePHPant
Icontem

File: tests/NodeTest.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  PHP Blake Chain  >  tests/NodeTest.php  >  Download  
File: tests/NodeTest.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Blake Chain
Create and verify chained blocks of hashed data
Author: By
Last change:
Date: 4 months ago
Size: 729 bytes
 

 

Contents

Class file image Download
<?php
namespace ParagonIE\Blakechain\UnitTests;

use
ParagonIE\Blakechain\Node;
use
PHPUnit\Framework\TestCase;

/**
 * Class NodeTest
 * @package ParagonIE\Blakechain\UnitTests
 */
class NodeTest extends TestCase
{
    public function
testNode()
    {
       
$first = new Node('Testing 123');
       
$second = new Node('Testing 456', $first->getHash(true));
       
$third = new Node('Testing 789', $second->getHash(true));

       
$fourth = clone $third;

       
$this->assertSame(
           
$third->getHash(),
           
$fourth->getHash()
        );
       
$fourth->setPrevHash($first->getHash(true));

       
$this->assertNotSame(
           
$third->getHash(),
           
$fourth->getHash()
        );
    }
}