Skip to content

Conversation

@biinari
Copy link
Collaborator

@biinari biinari commented Nov 8, 2021

Make tests more maintainable by separating each example into a separate test function.

Add assertions on the warning / error messages given.

// Assert that the warning messages for $file match those given (and there are no more / fewer warnings).
$this->assertWarningsMatch(
    $file,
    [
        $line => [
            $column => [
                $message
            ]
        ],
    ]
);
// Same for error messages
$this->assertErrorsMatch($file, $messages);

@biinari biinari marked this pull request as draft November 8, 2021 05:18
@biinari biinari force-pushed the separate_test_cases branch from eaae0ec to 880bd89 Compare November 8, 2021 05:44
Use a separate test function for each function / class example.
Also assert the messages that are given for each warning / error.
@biinari biinari force-pushed the separate_test_cases branch from 880bd89 to f3db7f8 Compare November 9, 2021 12:24
@biinari biinari marked this pull request as ready for review November 9, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant