Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
facets
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
facets
Commits
aa565af2
Commit
aa565af2
authored
Nov 13, 2015
by
Joris Vercammen
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Expand count-widget unit test"
This reverts commit
91f37870
.
parent
a174d29c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
+8
-11
8 additions, 11 deletions
...c/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
with
8 additions
and
11 deletions
tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
+
8
−
11
View file @
aa565af2
...
...
@@ -40,7 +40,6 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
new
Result
(
'llama'
,
'llama'
,
10
),
new
Result
(
'badger'
,
'badger'
,
5
),
new
Result
(
'duck'
,
'duck'
,
15
),
new
Result
(
'goose'
,
'goose'
,
15
),
];
$this
->
processor
=
new
CountWidgetOrderProcessor
([],
'count_widget_order'
,
[]);
...
...
@@ -50,6 +49,7 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
* Test sorting ascending.
*/
public
function
testAscending
()
{
$sorted_results
=
$this
->
processor
->
sortResults
(
$this
->
original_results
,
'ASC'
);
$this
->
assertEquals
(
5
,
$sorted_results
[
0
]
->
getCount
());
...
...
@@ -57,25 +57,22 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
$this
->
assertEquals
(
10
,
$sorted_results
[
1
]
->
getCount
());
$this
->
assertEquals
(
'llama'
,
$sorted_results
[
1
]
->
getDisplayValue
());
$this
->
assertEquals
(
15
,
$sorted_results
[
2
]
->
getCount
());
$this
->
assertEquals
(
'goose'
,
$sorted_results
[
2
]
->
getDisplayValue
());
$this
->
assertEquals
(
15
,
$sorted_results
[
3
]
->
getCount
());
$this
->
assertEquals
(
'duck'
,
$sorted_results
[
3
]
->
getDisplayValue
());
$this
->
assertEquals
(
'duck'
,
$sorted_results
[
2
]
->
getDisplayValue
());
}
/**
* Test sorting descending.
*/
public
function
testDescending
()
{
$sorted_results
=
$this
->
processor
->
sortResults
(
$this
->
original_results
,
'DESC'
);
$this
->
assertEquals
(
15
,
$sorted_results
[
0
]
->
getCount
());
$this
->
assertEquals
(
'goose'
,
$sorted_results
[
0
]
->
getDisplayValue
());
$this
->
assertEquals
(
15
,
$sorted_results
[
1
]
->
getCount
());
$this
->
assertEquals
(
'duck'
,
$sorted_results
[
1
]
->
getDisplayValue
());
$this
->
assertEquals
(
10
,
$sorted_results
[
2
]
->
getCount
());
$this
->
assertEquals
(
'llama'
,
$sorted_results
[
2
]
->
getDisplayValue
());
$this
->
assertEquals
(
5
,
$sorted_results
[
3
]
->
getCount
());
$this
->
assertEquals
(
'badger'
,
$sorted_results
[
3
]
->
getDisplayValue
());
$this
->
assertEquals
(
'duck'
,
$sorted_results
[
0
]
->
getDisplayValue
());
$this
->
assertEquals
(
10
,
$sorted_results
[
1
]
->
getCount
());
$this
->
assertEquals
(
'llama'
,
$sorted_results
[
1
]
->
getDisplayValue
());
$this
->
assertEquals
(
5
,
$sorted_results
[
2
]
->
getCount
());
$this
->
assertEquals
(
'badger'
,
$sorted_results
[
2
]
->
getDisplayValue
());
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment