Skip to content

Commit

Permalink
chore: cleanup the live test script
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreichtcs committed May 29, 2024
1 parent 45509e5 commit 0521331
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions example/GetEnrollmentReportLiveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
/**
* A live Enrollment Report test.
*
* This test expects the SMARTERU_ACCOUNT_KEY and SMARTERU_USER_KEY environment
* variables to be set. It will query the SMARTERU API for a list of all users
* in the SANDBOX group that are active and output their progress in the
* courses they are enrolled in, in CSV format.
*
* @copyright $year$ Core Business Solutions
* @license MIT
* @version $version$
Expand All @@ -15,23 +20,18 @@
require_once(__DIR__ . '/../vendor/autoload.php');

use CBS\SmarterU\Client;
use CBS\SmarterU\DataTypes\User;
use CBS\SmarterU\DataTypes\Timezone;
use CBS\SmarterU\Exceptions\SmarterUException;
use CBS\SmarterU\Queries\GetLearnerReportQuery;

/**
* This script contains a live test for Client::createUser. It was used to
* intentionally trigger errors and see how the API responds.
*/
$accountKey = getenv('SMARTERU_ACCOUNT_KEY') ?? 'No Account Key Provided';
$userKey = getenv('SMARTERU_USER_KEY') ?? 'No User Key Provided';

try {
// Create the Client for speaking to the API
$client = new Client($accountKey, $userKey);

// Create the user
// Query for an Enrollment report for all users in our SANDBOX group
// that are active. Add some optional fields that we care about.
$results = $client->getLearnerReport(
(new GetLearnerReportQuery())
->setGroupNames(['SANDBOX - Core Business Solutions'])
Expand Down

0 comments on commit 0521331

Please sign in to comment.