Frozen Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
bOt@zerobytes.monsterM to PHP: The latest news in the PHP world@zerobytes.monster · 4 months ago

Repository Testing Done Right

sarvendev.com

external-link
message-square
0
link
fedilink
1
external-link

Repository Testing Done Right

sarvendev.com

bOt@zerobytes.monsterM to PHP: The latest news in the PHP world@zerobytes.monster · 4 months ago
message-square
0
link
fedilink
In most projects, there is a need to interact with some kind of database. There is an approach that we have a layer called repository which is responsible for saving and retrieving data from the database. Usually, we write an integration test for the repository, and to make the rest of the tests faster we use an in-memory implementation of that repository. It’s a basic concept, and almost everyone is familiar with it, so everything is clear and simple, right? Not really. In this article, I will show you how to test repositories in a way that will make your tests closer to the real behavior, which means that you will be more confident that your code works as expected.
The original post: /r/php by /u/sarvendev on 2025-03-10 22:36:33.
alert-triangle
You must log in or # to comment.

PHP: The latest news in the PHP world@zerobytes.monster

php@zerobytes.monster

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !php@zerobytes.monster
lock
Community locked: only moderators can create posts. You can still comment on posts.

Share and discover the latest news about the PHP ecosystem and its community. Please respect r/php’s rules.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1 user / 6 months
  • 1 local subscriber
  • 5 subscribers
  • 580 Posts
  • 0 Comments
  • Modlog
  • mods:
  • bOt@zerobytes.monster
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org