mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
switch tests to snapshot assertions (#958)
* install spatie/phpunit-snapshot-assertions * switch GenerateBasicPhpdocFinal test to snapshot assertion * use v3 of spatie/phpunit-snapshot-assertions to be PHP7.2 compatible * add txt snapshot driver * fix EloquentCommandTest * replace all heredocs by snapshots * make test compatible with old/deprecated versions * Update composer.json * normalize composer.json * fix merge conflict * Allow older snapshot versions * normalize composer.json Co-authored-by: Barry vd. Heuvel <[email protected]> Co-authored-by: barryvdh <[email protected]>
This commit is contained in:
co-authored by
Barry vd. Heuvel
barryvdh
parent
cca99b6d25
commit
07d45d2d7a
@@ -40,19 +40,17 @@ class EloquentCommandTest extends TestCase
|
||||
|
||||
$tester = $this->runCommand($command);
|
||||
|
||||
$expectedContent = '/**
|
||||
*
|
||||
*
|
||||
* @mixin \Eloquent
|
||||
* @mixin \Illuminate\Database\Eloquent\Builder
|
||||
* @mixin \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
abstract class Model implements';
|
||||
$this->assertSame($expectedContent, $actualContent);
|
||||
$this->assertMatchesTxtSnapshot($actualContent);
|
||||
|
||||
$display = $tester->getDisplay();
|
||||
$this->assertRegExp(';Unexpected no document on Illuminate\\\Database\\\Eloquent\\\Model;', $display);
|
||||
$this->assertRegExp(';Wrote expected docblock to .*/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php;', $display);
|
||||
$this->assertRegExp(
|
||||
';Unexpected no document on Illuminate\\\Database\\\Eloquent\\\Model;',
|
||||
$display
|
||||
);
|
||||
$this->assertRegExp(
|
||||
';Wrote expected docblock to .*/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php;',
|
||||
$display
|
||||
);
|
||||
}
|
||||
|
||||
private function getVendorModelFilename(): string
|
||||
|
||||
Reference in New Issue
Block a user