<commit_before><?php
include_once "../website/php/WebsiteAPI.php";
include_once "APITest.php";
include_once "UserTest.php";

define("HISTORY_TABLE", "UserHistory");
const TEST_USER_HISTORY = array("userID" => "123", "lastNumGames" => "100", "lastNumPlayers" => "20", "versionNumber" => "1", "lastRank" => "2");
class HistoryTest extends APITest { 
	public function testGET() {
		$this->insertObject(HISTORY_TABLE, TEST_USER_HISTORY);
		
		$_GET['userID'] = TEST_USER_HISTORY['userID'];
		$_GET['REQUEST_METHOD'] = "POST";

    	$returnedHistory = json_decode((new WebsiteAPI("history"))->processAPI());

		$this->assertEquals($returnedHistory, TEST_USER_HISTORY);
	}
}
?><commit_msg>History test fix<commit_after><?php
include_once "../website/php/WebsiteAPI.php";
include_once "APITest.php";
include_once "UserTest.php";

define("HISTORY_TABLE", "UserHistory");
const TEST_USER_HISTORY = array("userID" => "123", "lastNumGames" => "100", "lastNumPlayers" => "20", "versionNumber" => "1", "lastRank" => "2");
class HistoryTest extends APITest { 
	public function testGET() {
		$this->insertObject(HISTORY_TABLE, TEST_USER_HISTORY);
		
		$_GET['userID'] = TEST_USER_HISTORY['userID'];
		$_SERVER['REQUEST_METHOD'] = "POST";

    	$returnedHistory = json_decode((new WebsiteAPI("history"))->processAPI(), true)[0];

		$this->assertArraySubset(TEST_USER_HISTORY, $returnedHistory);
	}
}
?>
{'fraction_non_alphanumeric': 0.18398268398268397, 'fraction_numerical': 0.015151515151515152, 'mean_word_length': 6.971264367816092, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4126241', 'n_tokens_mistral': 511, 'n_tokens_neox': 476, 'n_words': 81}