2017 © Pedro Peláez
 

library laravel-extend-testcase

Add more functionality to default Laravel 5.1 TestCase.

image

lanin/laravel-extend-testcase

Add more functionality to default Laravel 5.1 TestCase.

  • Tuesday, July 21, 2015
  • by lanin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel-Extend-TestCase

Add more functionality to default Laravel 5.1 TestCase., (*1)

Installation

PHP 5.5.9+ or HHVM 3.3+, Composer and Laravel 5.1+ are required., (*2)

To get the latest version of Laravel-Extend-TestCase, simply add the following line to the require block of your composer.json file., (*3)

"lanin/laravel-extend-testcase": "dev-master"

You'll then need to run composer install or composer update to download it and have the autoloader updated., (*4)

Once it was installed you don't have to register any ServiceProvider, Facade or publish any configs., (*5)

All you have to do is to extend your base Seeder class with \Lanin\TestCase\TestCase and you are ready to test!, (*6)

class TestCase extends \Lanin\TestCase\TestCase

API

/**
 * Fin or create first user (id => 1).
 *
 * @return \Illuminate\Contracts\Auth\Authenticatable|static
 */
protected function firstUser();

/**
 * Act like the first user.
 *
 * @return $this
 */
protected function actingAsFirstUser();

/**
 * Asserts that the response JSON contains the given path.
 * Example: $this->seeJsonMatchesPath('$.user.email');
 *
 * @param  string $path
 * @return $this
 * @throws PHPUnitException
 */
protected function seeJsonMatchesPath($path);

/**
 * Return value from the resulting JSON by path.
 * Example: $email = $this->getValueFromJsonByPath('$.user.email');
 *
 * @param  string  $path
 * @return mixed
 */
protected function getValueFromJsonByPath($path);

/**
 * Asserts that the response doesn't contain the given header.
 *
 * @param  string $headerName
 * @return $this
 */
protected function dontSeeHeader($headerName);

/**
 * Asserts that the response doesn't contain the given cookie.
 *
 * @param  string $cookieName
 * @return $this
 */
protected function dontSeeCookie($cookieName);

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities., (*7)

The Versions

21/07 2015

dev-master

9999999-dev

Add more functionality to default Laravel 5.1 TestCase.

  Sources   Download

MIT

The Requires

 

laravel phpunit framework tests testcase