@@ -42,16 +42,15 @@ final class question_test extends \advanced_testcase {
4242
4343 /**
4444 * Instance of the question type class
45- * @var
45+ * @var qtype_aitext
4646 */
47- public $ qtype ;
4847
4948 /**
50- * There is a live connection to the External AI system
51- * When run locally it will make a connection. Otherwise the
52- * tests will be skipped
53- * @var boolean
54- */
49+ * There is a live connection to the External AI system
50+ * When run locally it will make a connection. Otherwise the
51+ * tests will be skipped
52+ * @var bool
53+ */
5554 protected int $ islive ;
5655
5756 /**
@@ -63,22 +62,23 @@ final class question_test extends \advanced_testcase {
6362 */
6463 protected function setUp (): void {
6564 $ this ->qtype = new \qtype_aitext ();
66- if (defined ('TEST_LLM_APIKEY ' ) && defined ('TEST_LLM_ORGID ' )) {
67- set_config ('apikey ' , TEST_LLM_APIKEY , 'aiprovider_openai ' );
68- set_config ('orgid ' , TEST_LLM_ORGID , 'aiprovider_openai ' );
69- set_config ('enabled ' , true ,'aiprovider_openai ' );
70- $ this ->islive = true ;
71- }
65+ if (defined ('TEST_LLM_APIKEY ' ) && defined ('TEST_LLM_ORGID ' )) {
66+ set_config ('apikey ' , TEST_LLM_APIKEY , 'aiprovider_openai ' );
67+ set_config ('orgid ' , TEST_LLM_ORGID , 'aiprovider_openai ' );
68+ set_config ('enabled ' , true , 'aiprovider_openai ' );
69+ $ this ->islive = true ;
70+ }
7271 }
7372 /**
7473 * Make a trivial request to the LLM to check the code works
7574 * Only designed to test the 4.5 subsystem when run locally
7675 * not when in GHA ci
76+ * @covers \qtype_aitext\question::perform_request
7777 * @return void
7878 */
7979 public function test_perform_request (): void {
8080 $ this ->resetAfterTest (true );
81- if (!$ this ->islive ) {
81+ if (!$ this ->islive ) {
8282 $ this ->markTestSkipped ('No live connection to the AI system ' );
8383 }
8484 $ aitext = qtype_aitext_test_helper::make_aitext_question ([]);
0 commit comments