def METHOD_NAME(mocker, new_dir, confinement, stage_libc, text):
    shutil.copy("/bin/true", "elf.bin")
    shutil.copy("/lib/x86_64-linux-gnu/libdl.so.2", "elf.lib")
    if stage_libc:
        Path("lib64").mkdir()
        Path("lib64/ld-linux-x86-64.so.2").touch()
    mocker.patch("snapcraft.linters.linters.LINTERS", {"classic": ClassicLinter})
    mocker.patch(
        "snapcraft.elf._elf_file._determine_libraries",
        return_value={
            "libc.so.6": "/snap/core22/current/lib/x86_64-linux-gnu/libc.so.6"
        },
    )
    yaml_data = {
        "name": "mytest",
        "version": "1.29.3",
        "base": "core22",
        "summary": "Single-line elevator pitch for your amazing snap",
        "description": "test-description",
        "confinement": confinement,
        "parts": {},
    }
    project = projects.Project.unmarshal(yaml_data)
    snap_yaml.write(project, prime_dir=Path(new_dir), arch="amd64")
    issues = linters.run_linters(new_dir, lint=None)
    if confinement == "classic" or stage_libc:
        snap_name = "mytest" if stage_libc else "core22"
        assert issues == [
            LinterIssue(
                name="classic",
                result=LinterResult.OK,
                text=text,
            ),
            LinterIssue(
                name="classic",
                result=LinterResult.WARNING,
                filename="elf.bin",
                text=(
                    f"ELF interpreter should be set to "
                    f"'/snap/{snap_name}/current/lib64/ld-linux-x86-64.so.2'."
                ),
                url="https://snapcraft.io/docs/linters-classic",
            ),
            LinterIssue(
                name="classic",
                result=LinterResult.WARNING,
                filename="elf.bin",
                text="ELF rpath should be set to '/snap/core22/current/lib/x86_64-linux-gnu'.",
                url="https://snapcraft.io/docs/linters-classic",
            ),
            LinterIssue(
                name="classic",
                result=LinterResult.WARNING,
                filename="elf.lib",
                text="ELF rpath should be set to '/snap/core22/current/lib/x86_64-linux-gnu'.",
                url="https://snapcraft.io/docs/linters-classic",
            ),
        ]
    else:
        assert issues == []