2018-04-10 00:20:20 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* TextTest class.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Friendica\Test;
|
|
|
|
|
2019-07-16 04:27:42 +00:00
|
|
|
use Friendica\Model\Group;
|
2018-04-09 19:23:41 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-04-10 00:20:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests for text functions.
|
|
|
|
*/
|
2018-04-09 19:23:41 +00:00
|
|
|
class TextTest extends TestCase
|
2018-04-10 00:20:20 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* test hex2bin and reverse
|
|
|
|
*/
|
|
|
|
public function testHex2Bin()
|
|
|
|
{
|
|
|
|
$this->assertEquals(-3, hex2bin(bin2hex(-3)));
|
|
|
|
$this->assertEquals(0, hex2bin(bin2hex(0)));
|
|
|
|
$this->assertEquals(12, hex2bin(bin2hex(12)));
|
|
|
|
$this->assertEquals(PHP_INT_MAX, hex2bin(bin2hex(PHP_INT_MAX)));
|
|
|
|
}
|
|
|
|
}
|