src/Component/Legacy.php
protected function getLegacyName(string $type): string
    {
        $name = $this->testClassName;

        if (!preg_match('/Phase\d/', $name)) {
            throw new LegacyException(
                "Cannot generate Legacy name from class without 'Phase' followed by number in name " . $name
            );
        }

        $name = preg_replace('/Phase\d/', '', $name); // remove 'PhaseX' from the name
        $name = Strings::toFilename($name);

        if ($type == self::LEGACY_TYPE_TEST) {
            $name .= '#' . Strings::toFilename($this->tc->getName(false));
        }

        return $name;
    }
protected function getLegacyName(string $type): string
    {
        $name = $this->testClassName;

        if (!preg_match('/Phase\d/', $name)) {
            throw new LegacyException(
                "Cannot generate Legacy name from class without 'Phase' followed by number in name " . $name
            );
        }

        $name = preg_replace('/Phase\d/', '', $name); // remove 'PhaseX' from the name
        $name = Strings::toFilename($name);

        if ($type == self::LEGACY_TYPE_TEST) {
            $name .= '#' . Strings::toFilename($this->tc->getName(false));
        }

        return $name;
    }
Generates a filename (without path and extension) for the legacy based on the name of the test-case

@param string $type LEGACY_TYPE_CASE (shared by all tests in test case)
or LEGACY_TYPE_TEST (shared only by the same test function)
@throws LegacyException