@@ 46-55 (lines=10) @@ | ||
43 | /** |
|
44 | * @test |
|
45 | */ |
|
46 | public function canAddThreeItemsOrderDescByDefault() |
|
47 | { |
|
48 | $this->addItem('Title text', 10); |
|
49 | $this->addItem('Title text2', 15); |
|
50 | $this->addItem('Title text3', 7); |
|
51 | ||
52 | $json = json_encode($this->widget->getData()); |
|
53 | $this->assertEquals('{"items":[{"label":"Title text2","value":15},{"label":"Title text","value":10},'. |
|
54 | '{"label":"Title text3","value":7}]}', $json); |
|
55 | } |
|
56 | ||
57 | /** |
|
58 | * @test |
|
@@ 60-69 (lines=10) @@ | ||
57 | /** |
|
58 | * @test |
|
59 | */ |
|
60 | public function canAddThreeItemsOrderAsc() |
|
61 | { |
|
62 | $this->addItem('Title text', 10); |
|
63 | $this->addItem('Title text2', 15); |
|
64 | $this->addItem('Title text3', 7); |
|
65 | ||
66 | $json = json_encode($this->widget->getData(LeaderBoard::SORT_ASC)); |
|
67 | $this->assertEquals('{"items":[{"label":"Title text3","value":7},{"label":"Title text","value":10},'. |
|
68 | '{"label":"Title text2","value":15}]}', $json); |
|
69 | } |
|
70 | ||
71 | /** |
|
72 | * @param $label |