-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathNewBase60Test.php
More file actions
32 lines (27 loc) · 864 Bytes
/
NewBase60Test.php
File metadata and controls
32 lines (27 loc) · 864 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
<?php
class NewBase60Test extends PHPUnit_Framework_TestCase {
/**
* @dataProvider toSxgDataProvider
*/
public function testNumToSxg($expected, $input) {
$this->assertEquals($expected, num_to_sxg($input));
}
public function toSxgDataProvider() {
$tests = json_decode(file_get_contents(dirname(__FILE__).'/../test-data/num_to_sxg.json'));
return array_map(function($test){
return [$test->expect, $test->str];
}, $tests);
}
/**
* @dataProvider toNumDataProvider
*/
public function testSxgToNum($expected, $input) {
$this->assertEquals($expected, sxg_to_num($input));
}
public function toNumDataProvider() {
$tests = json_decode(file_get_contents(dirname(__FILE__).'/../test-data/sxg_to_num.json'));
return array_map(function($test){
return [$test->expect, $test->str];
}, $tests);
}
}