Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of useDatabase annotation #330

Open
2 tasks
emteknetnz opened this issue Nov 11, 2024 · 1 comment
Open
2 tasks

Make use of useDatabase annotation #330

emteknetnz opened this issue Nov 11, 2024 · 1 comment

Comments

@emteknetnz
Copy link
Member

SapphireTest can utilize a @useDatabase false annotation to not reset the database when there's a unit test method inside of test class that does use the database, either because $usesDatabase = true, or because a yml fixture file is being used. This saves a little running time.

Acceptance criteria

  • Create a code writer to identify unit test classes that use the database, and test methods inside those classes that don't use the database
  • Add the @useDatabase false annotation to those methods
@GuySartorelli
Copy link
Member

You can also set protected $usesDatabase = false; in a class to explicitly not use database for any tests in that class, which is probably preferable to annotating all the methods in that class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants