Writing Pest Tests for Laravel CRUD: Live-Coding

Поділитися
Вставка
  • Опубліковано 18 січ 2025

КОМЕНТАРІ • 31

  • @373323
    @373323 3 місяці тому +2

    good stuff, some subjects like this one for example have a lot of detail and deserve a longer video rather than getting chopped up or simplified to oblivion

  • @jkg_1
    @jkg_1 3 місяці тому +8

    Sir, we need a video about storage, symlinks, storage maintenance. Thanks

    • @LaravelDaily
      @LaravelDaily  3 місяці тому +5

      Ok adding to my to-do list

    • @hardiklakhalani6268
      @hardiklakhalani6268 3 місяці тому +1

      Right. Also seen some codebases with "bucket thing" in such modular way that we can choose where the files get stored.

    • @shire7949
      @shire7949 3 місяці тому

      How about "please"

  • @ziemustdie
    @ziemustdie 3 місяці тому +1

    Finally! Thanks so much

  • @fernandolamas330
    @fernandolamas330 3 місяці тому +1

    awesome lesson!!, huge thanks sr.!

  • @drugoviic
    @drugoviic 3 місяці тому +1

    I always create a .env.testing and use that to set my preferred database for testing i.e if youre using some sql methods unavailable in sqlite

  • @manojbist3793
    @manojbist3793 3 місяці тому

    Thanks for the lesson. Can you please make a video on CI/CD using different tools.

    • @LaravelDaily
      @LaravelDaily  3 місяці тому

      It's a very broad topic, and each tool is even deeper.
      So maybe a separate COURSE about it, would you buy it?

  • @capins85
    @capins85 3 місяці тому +1

    Nice explanation as always! I have a doubt: never find a tutorial to test Filament projects. Really don't know how to start

    • @LaravelDaily
      @LaravelDaily  3 місяці тому

      What exactly you want to test in Filament? Forms/tables are internally tested in core, and if you want to test on top, it's mostly Livewire testing, and it's all in the docs.

    • @capins85
      @capins85 3 місяці тому

      ​@@LaravelDaily It's complicate to answer you briefly:
      I learn Laravel with your video and courses, so I educate myself to "Separation of concern", "Stay consistent" and to test features, using controllers methods as a kind of schedule.
      So with Filament I feel myself a little bit confused: I love to have dashboard ready without losing time with styling, but sometimes I'm not pretty sure to have the control of what i'm doing, I feel like if I repeat code in many places, I don't find the same keystone that you give me with plain Laravel.
      Maybe should be intresting a series of code reviews about filament! I think that I get the best lessons from your code reviews

  • @darkbelg
    @darkbelg 3 місяці тому

    Should you use route names in tests? If you have a stand alone vue app. You can change the laravel urls and the tests will still show green. While your vue app will just fail or any external api.

    • @LaravelDaily
      @LaravelDaily  3 місяці тому +1

      My rule of thumb is always use route names, no matter the context.

  • @holakonoob
    @holakonoob 3 місяці тому +1

    if u have a big app like have 200+ model then its better to like use baseCrudTest class to not repeat it

  • @rakan6505
    @rakan6505 2 місяці тому

    I'm new to testing and have a question. Do I need to write tests for all endpoints in a CRUD? For instance, why should I test the display of the index or create pages when I can manually test them in the browser?

    • @LaravelDaily
      @LaravelDaily  2 місяці тому +1

      You can test them manually once when you create them but who will test if those pages still work after some other developers make any changes in the future? (which are not necessarily about those pages but may affect them)

  • @harshadevapriyankarabandar5456
    @harshadevapriyankarabandar5456 Місяць тому

    Which testing framework is better to learn for a developer who is new to testing: Pest or PHPUnit?

    • @LaravelDaily
      @LaravelDaily  Місяць тому

      If you're planning to work with Laravel projects, then Pest. If your plan is with general PHP projects or other frameworks, then phpunit.

  • @gdogmalone
    @gdogmalone 3 місяці тому +1

    What’s doing your auto completion please? Is that standard or an AI? 10:56 (😂answered at 12 minutes!)

  • @vladislavkresta1321
    @vladislavkresta1321 3 місяці тому

    What if my whole CRUD si based on Livewire so I don't have any POST routes to create User model?

    • @LaravelDaily
      @LaravelDaily  3 місяці тому

      In Livewire, tests are different, it's Livewire::test() from what I remember. So read the Livewire docs about testing.

    • @vladislavkresta1321
      @vladislavkresta1321 3 місяці тому

      @@LaravelDaily Great, looking forward it, thanks for your quick reply, appreciate it!

  • @stephenr85
    @stephenr85 4 дні тому

    Do you do contract/consulting work?

    • @LaravelDaily
      @LaravelDaily  4 дні тому

      No, not anymore, focused on content full-time.

  • @gilney.mathias
    @gilney.mathias 3 місяці тому +1

    Now do this on a 10+ years old legacy project 😭

    • @LaravelDaily
      @LaravelDaily  3 місяці тому +2

      Mission impossible.

    • @trap7369
      @trap7369 3 місяці тому +1

      @@LaravelDaily 😂😂😂

  • @lyrihkaesa
    @lyrihkaesa 3 місяці тому

    Can you explain how to test laravel dusk + pest on select filament search.

    • @LaravelDaily
      @LaravelDaily  3 місяці тому

      Haven't used that exact combination, so can't explain, sorry.