|
@@ 33-41 (lines=9) @@
|
| 30 |
|
$this->assertEquals('{"item":[{"text":"","value":35}],"type":null}', $json); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function testJsonForFullData() |
| 34 |
|
{ |
| 35 |
|
$widget = new NumberAndSecondaryStat(); |
| 36 |
|
$widget->setMainValue(100); |
| 37 |
|
$widget->setSecondaryValue(50); |
| 38 |
|
$widget->setMainPrefix('EUR'); |
| 39 |
|
$json = json_encode($widget->getData()); |
| 40 |
|
$this->assertEquals('{"item":[{"text":"","value":100,"prefix":"EUR"},{"text":"","value":50}],"type":null}', $json); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
public function testSettingADifferentType() |
| 44 |
|
{ |
|
@@ 43-50 (lines=8) @@
|
| 40 |
|
$this->assertEquals('{"item":[{"text":"","value":100,"prefix":"EUR"},{"text":"","value":50}],"type":null}', $json); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
public function testSettingADifferentType() |
| 44 |
|
{ |
| 45 |
|
$widget = new NumberAndSecondaryStat(); |
| 46 |
|
$widget->setMainValue(100); |
| 47 |
|
$widget->setType(NumberAndSecondaryStat::TYPE_REVERSE); |
| 48 |
|
$json = json_encode($widget->getData()); |
| 49 |
|
$this->assertEquals('{"item":[{"text":"","value":100}],"type":"reverse"}', $json); |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
public function testSetGetMainText() |
| 53 |
|
{ |