Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cayb0rg committed Feb 1, 2024
1 parent c3549e0 commit 7598e84
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions fuel/app/tests/api/v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,30 @@ public function test_widget_instances_get()

public function test_widget_paginate_user_instances_get()
{
// Create widget instance
$this->_as_author();
$title = "My Test Widget";
$question = 'What rhymes with harvest fests but are half as exciting (or tasty)';
$answer = 'Tests';
$qset = $this->create_new_qset($question, $answer);
$widget = $this->make_disposable_widget();

$instance = Api_V1::widget_instance_new($widget->id, $title, $qset, true);

// ----- loads author's instances --------
$output = Api_V1::widget_paginate_user_instances_get();
$this->assertIsArray($output);
$this->assertArrayHasKey('pagination', $output);
foreach ($output['pagination'] as $key => $value)
{
$this->assert_is_widget_instance($value, true);
}

// ======= AS NO ONE ========
\Auth::logout();
// ----- returns no login --------
$output = Api_V1::widget_paginate_user_instances_get();
$this->assert_invalid_login_message($output);
}

public function test_widget_instance_new()
Expand Down Expand Up @@ -1024,10 +1047,6 @@ public function test_play_logs_get()

}

public function test_paginated_play_logs_get()
{
}

public function test_score_summary_get()
{
// ======= AS NO ONE ========
Expand Down

0 comments on commit 7598e84

Please sign in to comment.