-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalization.php
More file actions
53 lines (40 loc) · 1.07 KB
/
Localization.php
File metadata and controls
53 lines (40 loc) · 1.07 KB
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
<?php
declare(strict_types=1);
/*
* This file is part of the QuidPHP package <https://quidphp.com>
* Author: Pierre-Philippe Emond <emondpph@gmail.com>
* License: https://github.com/quidphp/main/blob/master/LICENSE
*/
namespace Quid\Test\Main;
use Quid\Base;
use Quid\Main;
// localization
// class for testing Quid\Main\Localization
class Localization extends Base\Test
{
// trigger
final public static function trigger(array $data):bool
{
// construct
$l = new Main\Localization(['lat'=>2.2,'lng'=>2.1,'countryCode'=>'US','input'=>'test']);
$l2 = clone $l;
// toString
// onPrepareReplace
// cast
assert($l->_cast() === $l->toArray());
// inUsa
assert($l->inUsa());
// lat
assert($l->lat() === 2.2);
// lng
assert($l->lng() === 2.1);
// latLng
assert($l->latLng() === ['lat'=>2.2,'lng'=>2.1]);
// input
assert($l->input() === 'test');
// countryCode
assert($l->countryCode() === 'US');
return true;
}
}
?>