Skip to content

✨ TestBootstrap: dump canonical-data - #1072

Open
homersimpsons wants to merge 1 commit into
mainfrom
chore/bootstrap-improvements
Open

homersimpsons wants to merge 1 commit into
mainfrom
chore/bootstrap-improvements

Conversation

@homersimpsons

Copy link
Copy Markdown
Contributor

Test properties excluded:

  • uuid, description: already outputted
  • reimplements: does not make sense
  • comments: usually provided for reimplements
  • scenarios: seems mostly empty

Use of VarExporter:

  1. It allows the contributor to copy-paste the code directly
  2. json_encode was too verbose (pretty print) or too hard to read (normal)
  3. VarExporter is already used by the generator

Output:

    /** uuid: 64d97c14-36dd-44a8-9621-2cecebd6ed23 */
    #[PHPUnit\Framework\Attributes\TestDox('Accumulate empty')]
    public function testAccumulateEmpty(): void
    {
        // [
        //     'property' => 'accumulate',
        //     'input' => [
        //         'list' => [],
        //         'accumulator' => '(x) => x * x',
        //     ],
        //     'expected' => [],
        // ]
        $this->markTestIncomplete('This test has not been implemented yet.');
    }

Test properties excluded:
- `uuid`, `description`: already outputted
- `reimplements`: does not make sense
- `comments`: usually provided for reimplements
- `scenarios`: seems mostly empty

Use of `VarExporter`:
1. It allows the contributor to copy-paste the code directly
2. `json_encode` was too verbose (pretty print) or too hard to read (normal)
3. `VarExporter` is already used by the generator

Output:
```php
    /** uuid: 64d97c14-36dd-44a8-9621-2cecebd6ed23 */
    #[PHPUnit\Framework\Attributes\TestDox('Accumulate empty')]
    public function testAccumulateEmpty(): void
    {
        // [
        //     'property' => 'accumulate',
        //     'input' => [
        //         'list' => [],
        //         'accumulator' => '(x) => x * x',
        //     ],
        //     'expected' => [],
        // ]
        $this->markTestIncomplete('This test has not been implemented yet.');
    }
```
Comment thread contribution/main.php Resolved
@homersimpsons

Copy link
Copy Markdown
Contributor Author

Follow-up of #1071

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