To get the latest version of Laravel-Extend-TestCase, simply add the following line to the require block of your composer.json file.
You'll then need to run composer install or composer update to download it and have the autoloader updated.
Once it was installed you don't have to register any ServiceProvider, Facade or publish any configs.
All you have to do is to extend your base Seeder class with \Lanin\TestCase\TestCase and you are ready to test!
/** * Fin or create first user (id => 1). * * @return \Illuminate\Contracts\Auth\Authenticatable|static */protectedfunctionfirstUser();
/** * Act like the first user. * * @return $this */protectedfunctionactingAsFirstUser();
/** * Asserts that the response JSON contains the given path. * Example: $this->seeJsonMatchesPath('$.user.email'); * * @param string $path * @return $this * @throws PHPUnitException */protectedfunctionseeJsonMatchesPath($path);
/** * Return value from the resulting JSON by path. * Example: $email = $this->getValueFromJsonByPath('$.user.email'); * * @param string $path * @return mixed */protectedfunctiongetValueFromJsonByPath($path);
/** * Asserts that the response doesn't contain the given header. * * @param string $headerName * @return $this */protectedfunctiondontSeeHeader($headerName);
/** * Asserts that the response doesn't contain the given cookie. * * @param string $cookieName * @return $this */protectedfunctiondontSeeCookie($cookieName);
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.