We need more info. What does your travis.yml file look like? Any scripts for travis to run? Can we see your routes file? What kind of errors are you getting? Also, have you set a travis section in .env?
API Testing in Travis-CI
I am trying to setup API Testing in Laravel. We are using travis to automate the build and deploy process. I have tried many different things and up to this point I know that Laravel routing on the travis server does not work.
When the API test attempts to hit an endpoint it always returns 404 not found. I have tried adding "php artisan serve --port=80" to my scripts but it just holds the terminal window and does not continue the rest of the build. The only other option I have considered is to try and point all API calls to the actual URL rather than the masked one so something like ".php?route=something" in plain PHP terms.
I also stumbled upon this post if it helps anyone help me: https://laracasts.com/discuss/channels/testing/testing-api-calls-on-travis.
I've exhausted all of my options with this one and really need to get this working as it's on a very large project of mine. Any ideas would be greatly appreciated! I have listed one of my tests below.
function it_creates_a_thread()
{
$thread = factory(\App\Models\Forum\Thread::class)->make();
$thread->body = 'Testing';
$this->authUserPost($this->apiForumResource . '/thread', ['thread' => $thread->toArray()])
->seeInDatabase('forum_threads', ['title' => $thread->title])
->seeInDatabase('forum_posts', ['body' => $thread->body])
->seeJsonContains(['title' => $thread->title]);
}
Please or to participate in this conversation.