vendredi 3 février 2017

Laravel - Unit test for Method

I still new in Laravel, and I have to write a test for a class which has this method:

private function generateImageUrl($files)
    {
        $timestamp = time();
        $exploded_file_name = explode(".", $files->getClientOriginalName());
        $filename = $timestamp . "." . $exploded_file_name["1"];
        $files->move(env('PICTURES_REPO'), $filename);
        $fileUrl = $filename;
        return $fileUrl;
    }

How can I cover this method by test ?

Aucun commentaire:

Enregistrer un commentaire