2018-04-10 02:20:20 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* TextTest class.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Friendica\Test;
|
|
|
|
|
2019-07-16 06:27:42 +02:00
|
|
|
use Friendica\Model\Group;
|
2018-04-09 21:23:41 +02:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-04-10 02:20:20 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests for text functions.
|
|
|
|
*/
|
2018-04-09 21:23:41 +02:00
|
|
|
class TextTest extends TestCase
|
2018-04-10 02:20:20 +02: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)));
|
|
|
|
}
|
|
|
|
}
|