Skip to content

[testing] Formatter cache is not cleared after tests #3663

Description

@imorland

Current Behavior

When running tests which involve the Formatter, the formatter cache is not cleared at the end of the test run

Steps to Reproduce

  • Run a test which does not enable flarum/markdown
  • Write a test which enabled flarum/markdown
  • test the output
  • run both tests again, notice that the previous first test now fails

By adding

protected function tearDown(): void
    {
        parent::tearDown();

        resolve(Formatter::class)->flush();
    }

To the test class, behaviour is as would be expected.

Expected Behavior

The Formatter cache should be cleared as part of tearDown()

Screenshots

No response

Environment

  • Flarum version: x.y.z
  • Website URL: http://example.com
  • Webserver: [e.g. apache, nginx]
  • Hosting environment: [e.g. shared, vps]
  • PHP version: x.y.z
  • Browser: [e.g. chrome 67, safari 11]

Output of php flarum info

Output of "php flarum info", run this in terminal in your Flarum directory.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions