Skip to content

Commit d97cdfa

Browse files
committed
add sorting assertion (#69)
1 parent 2ce850d commit d97cdfa

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/base_test.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,33 @@ public function test_query_db_cached(): void {
9393
// After purging, we expect 13.
9494
$this->assertEquals(13, $nrofrows);
9595

96+
// Search for courses by name.
97+
$nrofrows = $this->get_rowscount_for_table(
98+
$table,
99+
0,
100+
null,
101+
null,
102+
null,
103+
null,
104+
null,
105+
null,
106+
'filtercourse'
107+
);
108+
$this->assertEquals(3, $nrofrows);
109+
110+
$nrofrows = $this->get_rowscount_for_table(
111+
$table,
112+
0,
113+
null,
114+
null,
115+
null,
116+
null,
117+
null,
118+
null,
119+
'Test course 9'
120+
);
121+
$this->assertEquals(1, $nrofrows);
122+
96123
// Now we want to test pagination.
97124
$this->create_test_courses(30);
98125

@@ -145,6 +172,9 @@ public function create_demo2_table() {
145172
$table->define_headers(array_values($columns));
146173
$table->define_columns(array_keys($columns));
147174

175+
$table->define_fulltextsearchcolumns(['fullname', 'shortname']);
176+
$table->define_sortablecolumns($columns);
177+
148178
$standardfilter = new standardfilter('fullname', 'fullname');
149179
$table->add_filter($standardfilter);
150180

0 commit comments

Comments
 (0)