Skip to content

Commit

Permalink
add sorting assertion (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
semteacher committed Jan 15, 2025
1 parent 2ce850d commit d97cdfa
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/base_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@ public function test_query_db_cached(): void {
// After purging, we expect 13.
$this->assertEquals(13, $nrofrows);

// Search for courses by name.
$nrofrows = $this->get_rowscount_for_table(
$table,
0,
null,
null,
null,
null,
null,
null,
'filtercourse'
);
$this->assertEquals(3, $nrofrows);

$nrofrows = $this->get_rowscount_for_table(
$table,
0,
null,
null,
null,
null,
null,
null,
'Test course 9'
);
$this->assertEquals(1, $nrofrows);

// Now we want to test pagination.
$this->create_test_courses(30);

Expand Down Expand Up @@ -145,6 +172,9 @@ public function create_demo2_table() {
$table->define_headers(array_values($columns));
$table->define_columns(array_keys($columns));

$table->define_fulltextsearchcolumns(['fullname', 'shortname']);
$table->define_sortablecolumns($columns);

$standardfilter = new standardfilter('fullname', 'fullname');
$table->add_filter($standardfilter);

Expand Down

0 comments on commit d97cdfa

Please sign in to comment.