generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from varemel/main
Fix telegraph fake attached files not clearing between fake requests (ISSUE-432)
- Loading branch information
Showing
5 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/Regression/Issue-432-ClearTelegraphFakeFilesForNewRequestTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
use DefStudio\Telegraph\Facades\Telegraph as TelegraphFacade; | ||
|
||
test('Clear Telegraph Fake attached files for every new request', function() { | ||
TelegraphFacade::fake(); | ||
$chat = make_chat(); | ||
$chat->photo(Storage::path('photo.jpg'))->message('test'); | ||
$telegraphB = $chat->message('123'); | ||
$filesB = $telegraphB->toArray()['files']; | ||
|
||
expect($filesB)->toBeEmpty(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace DefStudio\Telegraph\Tests\Unit\Storage; | ||
|
||
use DefStudio\Telegraph\Concerns\HasStorage; | ||
use DefStudio\Telegraph\Contracts\Storable; | ||
|
||
class TestStorable implements Storable { | ||
use HasStorage; | ||
|
||
public function storageKey(): string | ||
{ | ||
return 'foo'; | ||
} | ||
} |