nothingworksinc / ticketbeast

Back to the lesson videos:
https://course.testdrivenlaravel.com/lessons
552 stars 11 forks source link

How to test this? #54

Closed ebisbe closed 7 years ago

ebisbe commented 7 years ago

Hello Adam,

I've made this littlep pice of code that I'm not sure how tot test it. Can you guide me?

 /**
     * @param Request $request
     */
    public function byRequest(Request $request)
    {
        if ($request->getQueryString()) {
            $this->byLink($request->url());
        }
    }

The byLink() method is test it. And the byRequest method is test it with an acceptance test. But I wonder if this function should be test it as a unit test.

thanks

svenluijten commented 7 years ago

Hey @ebisbe, I'll repost what Adam posted in another issue (#53):

Please be conscious that when you open an issue on this repo, 2000+ people get an email about it 😬

Happy to try and help but I think somewhere like the Laracasts forum is a better place for general testing questions like this, vs. specific questions about something in the course.

This just seems like way too general a question that falls out of the scope of this course. 🙂