forked from leafo/scssphp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBase64VLQTest.php
More file actions
54 lines (49 loc) · 1007 Bytes
/
Base64VLQTest.php
File metadata and controls
54 lines (49 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* SCSSPHP
*
* @copyright 2018 Anthon Pang
*
* @license http://opensource.org/licenses/MIT MIT
*
* @link http://leafo.github.io/scssphp
*/
namespace Leafo\ScssPhp\Tests;
use Leafo\ScssPhp\SourceMap\Base64VLQ;
/**
* Base64VLQ encoder test
*
* @author Anthon Pang <anthon.pang@gmail.com>
*/
class Base64VLQTest extends \PHPUnit_Framework_TestCase
{
/**
* Test encode
*
* param string $expected
* param string $value
*
* @dataProvider getEncode
*/
public function testEncode($expected, $value)
{
$encoder = new Base64VLQ;
$this->assertEquals($expected, $encoder->encode($value));
}
/**
* Data provider for testEncode
*
* @return array
*/
public static function getEncode()
{
return [
['A', 0],
['C', 1],
['D', -1],
['2H', 123],
['qxmvrH', 123456789],
['+/////D', 2147483647], // 2^31-1
];
}
}