def METHOD_NAME(configuration, metadata, set_wazuh_configuration, test_folders,
                                    create_monitored_folders, configure_local_internal_options_function,
                                    restart_syscheck_function, wait_syscheck_start):
    '''
    description: Check if the 'ignore' tag prevails over the 'restrict' one when using both in the same directory.
                 For example, when a directory is ignored and at the same time monitoring is restricted to a file
                 that is in that directory, no FIM events should be generated when that file is modified.
                 For this purpose, the test case configuration is applied, and it is checked if FIM events
                 are generated when required.
    test_phases:
        - setup:
            - Set wazuh configuration and local_internal_options.
            - Create custom folder for monitoring
            - Clean logs files and restart wazuh to apply the configuration.
        - test:
            - Create file and detect event creation event
            - Validate ignored event is generated with matching regex
        - teardown:
            - Delete custom monitored folder
            - Restore configuration
            - Stop Wazuh
    wazuh_min_version: 4.2.0
    tier: 2
    parameters:
        - configuration:
            type: dict
            brief: Configuration values for ossec.conf.
        - metadata:
            type: dict
            brief: Test case data.
        - test_folders:
            type: dict
            brief: List of folders to be created for monitoring.
        - set_wazuh_configuration:
            type: fixture
            brief: Set ossec.conf configuration.
        - create_monitored_folders_module:
            type: fixture
            brief: Create a given list of folders when the module starts. Delete the folders at the end of the module.
        - configure_local_internal_options_function:
            type: fixture
            brief: Set local_internal_options.conf file.
        - restart_syscheck_function:
            type: fixture
            brief: restart syscheckd daemon, and truncate the ossec.log.
        - wait_syscheck_start:
            type: fixture
            brief: check that the starting FIM scan is detected.
    assertions:
        - Verify that when a directory is ignored, the 'restrict' attribute
          is not taken into account to generate FIM events.
    input_description: The file 'configuration_works_over_restrict.yaml' provides the configuration
                       template.
                       The file 'cases_ignore_works_over_restrict.yaml' provides the tes cases configuration
                       details for each test case.
    expected_output:
        - r".*Ignoring '.*?' '(.*?)' due to (sregex|pattern)? '.*?'" (When the FIM event should be ignored)
    tags:
        - scheduled
    '''
    wazuh_log_monitor = FileMonitor(LOG_FILE_PATH)
    folder = test_directories[metadata['folder_index']]
    filename = metadata['filename']
    # Create file that must be ignored
    create_file(REGULAR, folder, filename, content='')
    regex = CB_IGNORING_DUE_TO_PATTERN if metadata['is_pattern'] else CB_IGNORING_DUE_TO_SREGEX
    matching_log = wazuh_log_monitor.start(timeout=T_10, accum_results=2, callback=generate_monitoring_callback(regex),
                                           error_message=f'Did not receive expected '
                                                         f'"Ignoring ... due to ..." event for file '
                                                         f'{os.path.join(folder, filename)}').result()
    assert os.path.join(folder, filename) in matching_log, "Ignored file log is not generated."