mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
use Pest\TestSuite;
|
|
|
|
beforeEach(function () {
|
|
$this->snapshotable = <<<'HTML'
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<h1>Snapshot</h1>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
HTML;
|
|
});
|
|
|
|
test('pass with dataset', function ($data) {
|
|
TestSuite::getInstance()->snapshots->save($this->snapshotable);
|
|
[$filename] = TestSuite::getInstance()->snapshots->get();
|
|
|
|
expect($filename)->toStartWith('tests/.pest/snapshots-external/')
|
|
->toEndWith('pass_with_dataset_with_data_set____my_datas_set_value___.snap')
|
|
->and($this->snapshotable)->toMatchSnapshot();
|
|
})->with(['my-datas-set-value']);
|
|
|
|
describe('within describe', function () {
|
|
test('pass with dataset', function ($data) {
|
|
TestSuite::getInstance()->snapshots->save($this->snapshotable);
|
|
[$filename] = TestSuite::getInstance()->snapshots->get();
|
|
|
|
expect($filename)->toStartWith('tests/.pest/snapshots-external/')
|
|
->toEndWith('pass_with_dataset_with_data_set____my_datas_set_value___.snap')
|
|
->and($this->snapshotable)->toMatchSnapshot();
|
|
});
|
|
})->with(['my-datas-set-value']);
|