<commit_before><?php

use ElkArte\Cache\Cache;
use ElkArte\HttpReq;
use ElkArte\Search\Search;
use ElkArte\Search\SearchApiWrapper;
use ElkArte\Search\SearchParams;
use ElkArte\Search\WeightFactors;
use ElkArte\User;
use ElkArte\UserSettingsLoader;
use ElkArte\ValuesContainer;
use PHPUnit\Framework\TestCase;

/**
 * Class TestSearchclass
 */
class TestSearchclass extends TestCase
{
	protected $backupGlobalsBlacklist = ['user_info'];
	protected $member_full_access;
	protected $member_limited_access;

	/**
	 * Prepare what is necessary to use in these tests.
	 *
	 * setUpBeforeClass() is run automatically by the testing framework just once before any test method.
	 */
	public static function setUpBeforeClass(): void
	{
		// This is here to cheat with allowedTo
		User::$info = new ValuesContainer([
			'is_admin' => true,
			'is_guest' => false,
			'possibly_robot' => false,
			'groups' => array(0 => 1),
			'permissions' => array('admin_forum'),
		]);

		// Create 2 boards
		require_once(SUBSDIR . '/Boards.subs.php');
		$board_all_access = createBoard([
			'board_name' => 'Search 1',
			'redirect' => '',
			'move_to' => 'bottom',
			'target_category' => 1,
			'access_groups' => [0,1],
			'deny_groups' => [],
			'profile' => '1',
			'inherit_permissions' => false,
		]);<commit_msg>! fix tests<commit_after><?php

use ElkArte\Cache\Cache;
use ElkArte\HttpReq;
use ElkArte\Search\Search;
use ElkArte\Search\SearchApiWrapper;
use ElkArte\Search\SearchParams;
use ElkArte\Search\WeightFactors;
use ElkArte\User;
use ElkArte\UserSettingsLoader;
use ElkArte\ValuesContainer;
use PHPUnit\Framework\TestCase;

/**
 * Class TestSearchclass
 */
class TestSearchclass extends TestCase
{
	protected $backupGlobalsBlacklist = ['user_info'];
	protected $member_full_access;
	protected $member_limited_access;

	/**
	 * Prepare what is necessary to use in these tests.
	 *
	 * setUpBeforeClass() is run automatically by the testing framework just once before any test method.
	 */
	public static function setUpBeforeClass(): void
	{
		// This is here to cheat with allowedTo
		User::$info = new ValuesContainer([
			'id' => 1,
			'ip' => long2ip(rand(0, 2147483647)),
			'is_admin' => true,
			'is_guest' => false,
			'possibly_robot' => false,
			'groups' => array(0 => 1),
			'permissions' => array('admin_forum'),
		]);

		// Create 2 boards
		require_once(SUBSDIR . '/Boards.subs.php');
		$board_all_access = createBoard([
			'board_name' => 'Search 1',
			'redirect' => '',
			'move_to' => 'bottom',
			'target_category' => 1,
			'access_groups' => [0,1],
			'deny_groups' => [],
			'profile' => '1',
			'inherit_permissions' => false,
		]);
{'fraction_non_alphanumeric': 0.1420476010578013, 'fraction_numerical': 0.01095579901775595, 'mean_word_length': 4.317269076305221, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '963709', 'n_tokens_mistral': 1006, 'n_tokens_neox': 904, 'n_words': 217}