Skip to content

HighSchoolSweetheart - TASK 4 | Put the initials inside of the heart #1002

@phoenix3355

Description

@phoenix3355

🐛 Flaw in Test Suite: HighSchoolSweetheart::pair can be hardcoded and still pass

Description

The test suite for Task 4 ("Put the initials inside of the heart") does not sufficiently validate that the pair() method dynamically processes the input arguments ($sweetheart_a and $sweetheart_b).

Currently, it is possible to bypass the logic entirely by hardcoding a static HEREBY/HEREDOC string with specific initials directly into the method body.

Steps to Reproduce / Proof of Concept

If I replace the entire logic of the pair method with a hardcoded string like this:

public function pair(string $sweetheart_a, string $sweetheart_b): string
{
$expected = <<<EXPECTED_HEART
****** ******
** ** ** **
** ** ** **
** * **
** **
** A. B. + C. D. **
** **
** **
** **
** **
** **
** **
***
*
EXPECTED_HEART;
return $expected;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions