Skip to content

Conversation

@buismaarten
Copy link

In my project I have the following:

    #[Test]
    #[TestWith(['name' => 'dummy_name'])]
    public function testCompile(string $name): void
    {
        $result = [... retrieve file based on $name ...];

        $this->setSnapshotId($name);
        $this->assertMatchesSnapshot($result);
    }

This way it is possible to store the snapshot file using the same filename (without extension), to easily find the snapshot file based on the input file. At this moment I need to add extra code for this to make it work.

Example:

  • fixtures/dummy_name.txt
  • snapshots/dummy_name.yml

Let me know if unit tests are needed for this.

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