Skip to content

Tag: testing

Testing in laravel against MySQL

Hello i m testing in laravel 5.5 an api using Mysql as database and DatabaseTransactions. Suppose that i have a model Team which may be active or inactive and i want to test getting an inactive Team. This piece of code is problematic if there is no inactive team in my fake seeded database. So what’s the…

Using logical or in seeInDatabase

How can I implement a logic ‘or’ operator in Codeception’s seeInDatabase method?. For example: the methods syntax is Which generates this query How can I generate the following query? Answer you can try this- Or You can do this split into some simple steps. First get the records- then test- …

Run only one unit test from a test suite in laravel

Using phpunit command Laravel will run all unit tests in our project. How to run one or specific Unit Tests in Laravel 5.1? I just want to run testFindToken from my test suite. Answer Use this command to run a specific test from your test suite. If you want to be more specific about your file then pass the fi…