I just made a package for Laravel, it allows a model to be favorited by a User. I want to know how to make some tests, so I can implement travis CI when someone else makes a pull request.
The point is I dont know how to make a User model and Another demo model and then make them use my package trait in a test like travis CI.
@kuri Since the package will install in a Laravel project, the tests can use the User model in Laravel. You can just create another model and test with that as well. Just remember the testing paths have to be checked and consider using Orchestral for testing. It was created for testing Laravel packages. Just create your own TestCase class using Orchestral.
use Orchestra\Testbench\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
public function setUp()
{
parent::setUp();
}
}
I use Travis. If you want samples, check out all of Spatie packages on GitHub. Travis just runs your tests when you commit so the fact that you would use Orchestral doesn't matter to Travis.