While watching this it made me think of maybe a good scenario to do a video on. What if you had a bit of a legacy Laravel app and wanted to introduce testing. Take a simple blog/comments app that already has data in the database, there would no migrations or seeders. How would you set up testing, could you use refresh database etc?
@@LaravelDaily is there really that much work involved? I think that right justify a course on it. We too often get the nice/happy path in tutorials which can halt problem solving skills
so a project i have been working on and off for a while, with only migrations and at a point another dev had to add features and went straight to adding tables and columns directly into the db and requiring everying to now have an actual copy. lucky there is a package that can look at your database and spin up migration files for you. so i did that then gradually worked in some seeders and minimum test over a couple of days. but then i wanted to use sqlite and run into the same kind of challenges Povilas run to in this video because the running databases are mysql. testing in an environment that is different from what your production environment will be honest is a waste of effort and time unless you have some business case. Around this same point, i used to develop heavily on windows and deploy to linux and then i started running into issues like the code works fine on windows but will not follow my orders no matter how much i beg and debug. Long story short i just installed a vm to run linux and all development work so that i have the same environment as my servers... and it is support enjoyable. The knowledge and experience gained from running into issues and prod and on local is now sharable. but a question to Povillas, realising that sqlite is useful due to how fast it can run unit test. can you share insights into getting sqlite to work for unit test or would you share my opinion of not wasting time on it if we can use useDatabaseRefresh to make the reasonably performant because honestly i think if all tests are completing in a good amount of time the struggling to fix sqllite issues is a distraction and takes away time from solving or working on features that bring revenue or strenghtens the position of the business. However if you have test that take a while and realise sqlite can reduce the testing time by a good factor or quantity then it definitly makes sense to spend time on it to get it to work because it is going to count towards improvement of the position and revenue of the business
Thanks for the stream as always!~ Anyway, can you make a course about laravel testing via browser interaction like from jquery (show/hide modal, ajax, etc.)? I want to start writing a test, but I'm using jquery for all of my projects and incoming projects. Thanks in advance.
Always useful, thanks a lot Sir 🙏. I'll improve my tests 💪
I forgot to refactor the academic year test🤣🤣
It was useful, I really appreciate it
While watching this it made me think of maybe a good scenario to do a video on. What if you had a bit of a legacy Laravel app and wanted to introduce testing.
Take a simple blog/comments app that already has data in the database, there would no migrations or seeders. How would you set up testing, could you use refresh database etc?
Good idea, but that's not a video, it would be a 4-hour course marked as "horror stories" :) not sure if people would pay for it
@@LaravelDaily is there really that much work involved? I think that right justify a course on it. We too often get the nice/happy path in tutorials which can halt problem solving skills
The last time I had to upgrade Laravel 5.4 app to Laravel 8, it took 3 weeks full time.
so a project i have been working on and off for a while, with only migrations and at a point another dev had to add features and went straight to adding tables and columns directly into the db and requiring everying to now have an actual copy.
lucky there is a package that can look at your database and spin up migration files for you. so i did that then gradually worked in some seeders and minimum test over a couple of days.
but then i wanted to use sqlite and run into the same kind of challenges Povilas run to in this video because the running databases are mysql.
testing in an environment that is different from what your production environment will be honest is a waste of effort and time unless you have some business case.
Around this same point, i used to develop heavily on windows and deploy to linux and then i started running into issues like the code works fine on windows but will not follow my orders no matter how much i beg and debug.
Long story short i just installed a vm to run linux and all development work so that i have the same environment as my servers... and it is support enjoyable.
The knowledge and experience gained from running into issues and prod and on local is now sharable.
but a question to Povillas, realising that sqlite is useful due to how fast it can run unit test.
can you share insights into getting sqlite to work for unit test or would you share my opinion of not wasting time on it if we can use useDatabaseRefresh to make the reasonably performant because honestly i think if all tests are completing in a good amount of time the struggling to fix sqllite issues is a distraction and takes away time from solving or working on features that bring revenue or strenghtens the position of the business.
However if you have test that take a while and realise sqlite can reduce the testing time by a good factor or quantity then it definitly makes sense to spend time on it to get it to work because it is going to count towards improvement of the position and revenue of the business
Hi, how did you set up MySQL test database? Spent a few weeks trying to configure it and I just run into a wall every time.
I have 2565 tests for my business site. I don't deploy anything to it without tests.
O.o how many loc you have for all these tests?
@@trap7369 I don't know what you mean by "loc"
hi
I'm struggling with subscription I'm getting my card (The card was declined.)
I double-checked the amount and it's OK
Sorry but I can't do much about it, payments are handled by the Teachable platform, email support@teachable.com
Thanks for the stream as always!~
Anyway, can you make a course about laravel testing via browser interaction like from jquery (show/hide modal, ajax, etc.)? I want to start writing a test, but I'm using jquery for all of my projects and incoming projects. Thanks in advance.
Then tou probably need Laravel Dusk, read its documentation.
Thx Povilas!
Is it possible to save something in env from controller method?
I would not advice on that, but yes
Please do not do this
@@yungifez why?
@@jatinchauhan323 for what purposes exactly
@@jatinchauhan323 i wrote a method for this
But not in controller
@@yungifez what is it?