Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imanghafoori1/laravel-makesure
Readable syntax to write tests in laravel
https://github.com/imanghafoori1/laravel-makesure
laravel laravel-test laravel-testing
Last synced: 3 months ago
JSON representation
Readable syntax to write tests in laravel
- Host: GitHub
- URL: https://github.com/imanghafoori1/laravel-makesure
- Owner: imanghafoori1
- License: mit
- Created: 2018-12-22T20:32:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T18:47:18.000Z (about 1 year ago)
- Last Synced: 2024-10-12T10:43:52.704Z (3 months ago)
- Topics: laravel, laravel-test, laravel-testing
- Language: PHP
- Size: 111 KB
- Stars: 21
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel MakeSure
Easier tests for laravel
[![StyleCI](https://github.styleci.io/repos/162841027/shield?branch=master)](https://github.styleci.io/repos/162841027)
[![Build Status](https://travis-ci.org/imanghafoori1/laravel-makesure.svg?branch=master)](https://travis-ci.org/imanghafoori1/laravel-makesure)This package tries to give you a more readable syntax to write
### Installation
```
composer require imanghafoori/laravel-makesure --dev
```
### Usage
You can use it like this :
```php
MakeSure::about($this)->
->sendingGetRequest('some-url')
->isRespondedWith()
->statusCode(402);// Instead of writing this :
$this
->get('some-url')
->assertStatus(402);```
You should start of with the `MakeSure` alias or the `Imanghafoori\MakeSure\Facades\MakeSure` Facade class like this:
```
MakeSure::about($this)->...
```
Note that for technical reasons you should always pass $this into the `about` method.
then you have access to all of these methods:
```
sendingPostRequest
sendingJsonPostRequest
sendingDeleteRequest
sendingJsonDeleteRequest
sendingPutRequest
sendingJsonPutRequest
sendingPatchRequest
sendingJsonPatchRequest
sendingGetRequest
sendingJsonGetRequest
```