https://github.com/matthewbdaly/laravel-golden-master-tests
A Laravel package allowing for easy golden master tests when writing better tests isn't practical
https://github.com/matthewbdaly/laravel-golden-master-tests
Last synced: 3 months ago
JSON representation
A Laravel package allowing for easy golden master tests when writing better tests isn't practical
- Host: GitHub
- URL: https://github.com/matthewbdaly/laravel-golden-master-tests
- Owner: matthewbdaly
- License: mit
- Created: 2019-05-14T09:57:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T09:01:08.000Z (about 6 years ago)
- Last Synced: 2025-02-20T15:48:17.802Z (3 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-golden-master-tests
Class for golden master tests in Laravel.
Installation
------------```bash
$ composer require --dev matthewbdaly/laravel-golden-master-tests
```Usage
-----```php
create([
'email' => '[email protected]',
'name' => 'Eric Smith',
'password' => 'password'
]);
$this->actingAs($user)
->goto($data)
->saveHtml()
->assertSnapshotsMatch();
}/**
* @dataProvider nonAuthDataProvider
*/
public function testNonAuthPages($data)
{
$this->goto($data)
->saveHtml()
->assertSnapshotsMatch();
}public function authDataProvider()
{
return [
['/'],
];
}public function nonAuthDataProvider()
{
return [
['/register'],
['/login'],
];
}
}
```