承接 lanin/laravel-extend-testcase 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lanin/laravel-extend-testcase

Composer 安装命令:

composer require lanin/laravel-extend-testcase

包简介

Add more functionality to default Laravel 5.1 TestCase.

README 文档

README

Add more functionality to default Laravel 5.1 TestCase.

Installation

PHP 5.5.9+ or HHVM 3.3+, Composer and Laravel 5.1+ are required.

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

"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.

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!

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
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-21