<commit_before><?php

declare(strict_types=1);

namespace App\Tests\Endpoints;

use App\Entity\UserSessionMaterialStatusInterface;
use App\Tests\Fixture\LoadUserSessionMaterialStatusData;
use App\Tests\ReadWriteEndpointTest;

/**
 * UserSessionMaterialStatusTest API endpoint Test.
 * @group api_1
 */
class UserSessionMaterialStatusTest extends ReadWriteEndpointTest
{
    protected string $testName =  'userSessionMaterialStatuses';

    protected function getFixtures(): array
    {
        return [
            LoadUserSessionMaterialStatusData::class,
        ];
    }

    public function putsToTest(): array
    {
        return [
            'statusStarted' => ['status', UserSessionMaterialStatusInterface::STARTED],
            'statusComplete' => ['status', UserSessionMaterialStatusInterface::COMPLETE],
            'material' => ['material', 2],
        ];
    }

    public function readOnlyPropertiesToTest(): array
    {
        return [
            'id' => ['id', 1, 99],
            'updatedAt' => ['updatedAt', 1, '2015-01-01'],
        ];
    }

    public function filtersToTest(): array
    {
        return [
            'id' => [[0], ['id' => 1]],
            'ids' => [[0, 2], ['id' => [1, 3]]],
            'status' => [[0], ['status' => UserSessionMaterialStatusInterface::NONE]],
            'statuses' => [[0, 1], ['status' => [
                UserSessionMaterialStatusInterface::NONE,
                UserSessionMaterialStatusInterface::STARTED
            ]]],
            'material' => [[1], ['material' => 3]],
            'materials' => [[0, 2], ['material' => [1, 5]]],
        ];
    }

    protected function getTimeStampFields(): array
    {
        return ['updatedAt'];
    }<commit_msg>Add test to filter by user<commit_after><?php

declare(strict_types=1);

namespace App\Tests\Endpoints;

use App\Entity\UserSessionMaterialStatusInterface;
use App\Tests\Fixture\LoadUserSessionMaterialStatusData;
use App\Tests\ReadWriteEndpointTest;

/**
 * UserSessionMaterialStatusTest API endpoint Test.
 * @group api_1
 */
class UserSessionMaterialStatusTest extends ReadWriteEndpointTest
{
    protected string $testName =  'userSessionMaterialStatuses';

    protected function getFixtures(): array
    {
        return [
            LoadUserSessionMaterialStatusData::class,
        ];
    }

    public function putsToTest(): array
    {
        return [
            'statusStarted' => ['status', UserSessionMaterialStatusInterface::STARTED],
            'statusComplete' => ['status', UserSessionMaterialStatusInterface::COMPLETE],
            'material' => ['material', 2],
        ];
    }

    public function readOnlyPropertiesToTest(): array
    {
        return [
            'id' => ['id', 1, 99],
            'updatedAt' => ['updatedAt', 1, '2015-01-01'],
        ];
    }

    public function filtersToTest(): array
    {
        return [
            'id' => [[0], ['id' => 1]],
            'ids' => [[0, 2], ['id' => [1, 3]]],
            'status' => [[0], ['status' => UserSessionMaterialStatusInterface::NONE]],
            'statuses' => [[0, 1], ['status' => [
                UserSessionMaterialStatusInterface::NONE,
                UserSessionMaterialStatusInterface::STARTED
            ]]],
            'material' => [[1], ['material' => 3]],
            'materials' => [[0, 2], ['material' => [1, 5]]],
            'user' => [[0, 1, 2], ['user' => 2]],
            'users' => [[0, 1, 2], ['user' => [2]]],
        ];
    }

    protected function getTimeStampFields(): array
    {
        return ['updatedAt'];
    }
{'fraction_non_alphanumeric': 0.1539753639417693, 'fraction_numerical': 0.019036954087346025, 'mean_word_length': 2.47568093385214, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '3827307', 'n_tokens_mistral': 1031, 'n_tokens_neox': 984, 'n_words': 213}