Passed
Push — nullBounds ( b3e7e4...f3529c )
by no
03:35
created

BasicNumberLocalizerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideLocalizeNumber() 0 14 1
A testLocalizeNumber() 0 6 1
1
<?php
2
3
namespace ValueParsers\Test;
4
5
use ValueFormatters\BasicNumberLocalizer;
6
7
/**
8
 * @covers ValueFormatters\BasicNumberLocalizer
9
 *
10
 * @group DataValue
11
 * @group DataValueExtensions
12
 *
13
 * @license GPL-2.0+
14
 * @author Daniel Kinzler
15
 */
16
class BasicNumberLocalizerTest extends \PHPUnit_Framework_TestCase {
17
18
	public function provideLocalizeNumber() {
19
		return array(
20
			array( '5', '5' ),
21
			array( '+3', '+3' ),
22
			array( '-15', '-15' ),
23
24
			array( '5.3', '5.3' ),
25
			array( '+3.2', '+3.2' ),
26
			array( '-15.77', '-15.77' ),
27
28
			array( 77, '77' ),
29
			array( -7.7, '-7.7' ),
30
		);
31
	}
32
33
	/**
34
	 * @dataProvider provideLocalizeNumber
35
	 */
36
	public function testLocalizeNumber( $localized, $expected ) {
37
		$localizer = new BasicNumberLocalizer();
38
		$localized = $localizer->localizeNumber( $localized );
39
40
		$this->assertEquals( $expected, $localized );
41
	}
42
43
}
44