File tree Expand file tree Collapse file tree 7 files changed +14
-17
lines changed
Expand file tree Collapse file tree 7 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 33namespace Sammyjo20 \Saloon \Http ;
44
55use Sammyjo20 \Saloon \Helpers \Storage ;
6+ use Sammyjo20 \Saloon \Data \FixtureData ;
67use Sammyjo20 \Saloon \Helpers \MockConfig ;
78use Sammyjo20 \Saloon \Exceptions \FixtureMissingException ;
89use Sammyjo20 \Saloon \Exceptions \DirectoryNotFoundException ;
9- use Sammyjo20 \Saloon \Data \FixtureData ;
1010
1111class Fixture
1212{
Original file line number Diff line number Diff line change 44
55use Sammyjo20 \Saloon \Http \Fixture ;
66use Psr \Http \Message \RequestInterface ;
7- use Psr \Http \Message \ResponseInterface ;
87use Sammyjo20 \Saloon \Data \FixtureData ;
8+ use Psr \Http \Message \ResponseInterface ;
99
1010class FixtureRecorderMiddleware
1111{
Original file line number Diff line number Diff line change 11<?php
22
33use League \Flysystem \Filesystem ;
4- use League \Flysystem \Local \LocalFilesystemAdapter ;
54use Sammyjo20 \Saloon \Http \Fixture ;
65use Sammyjo20 \Saloon \Http \MockResponse ;
76use Sammyjo20 \Saloon \Clients \MockClient ;
87use Sammyjo20 \Saloon \Http \SaloonRequest ;
8+ use League \Flysystem \Local \LocalFilesystemAdapter ;
99use Sammyjo20 \Saloon \Tests \Fixtures \Requests \UserRequest ;
1010use Sammyjo20 \Saloon \Tests \Fixtures \Requests \ErrorRequest ;
1111use Sammyjo20 \Saloon \Tests \Fixtures \Connectors \TestConnector ;
@@ -418,7 +418,7 @@ function (SaloonRequest $request): MockResponse {
418418 }
419419
420420 return MockResponse::fixture ('other ' );
421- }
421+ },
422422 ]);
423423
424424 expect ($ filesystem ->fileExists ('user.json ' ))->toBeFalse ();
Original file line number Diff line number Diff line change 2424|
2525*/
2626
27- use Sammyjo20 \Saloon \Helpers \MockConfig ;
2827
2928expect ()->extend ('toBeOne ' , function () {
3029 return $ this ->toBe (1 );
Original file line number Diff line number Diff line change 99 $ data = [
1010 'statusCode ' => 200 ,
1111 'headers ' => [
12- 'Content-Type ' => 'application/json '
12+ 'Content-Type ' => 'application/json ' ,
1313 ],
1414 'data ' => [
15- 'name ' => 'Sam '
15+ 'name ' => 'Sam ' ,
1616 ],
1717 ];
1818
2727 $ data = [
2828 'statusCode ' => 200 ,
2929 'headers ' => [
30- 'Content-Type ' => 'application/json '
30+ 'Content-Type ' => 'application/json ' ,
3131 ],
3232 'data ' => [
33- 'name ' => 'Sam '
33+ 'name ' => 'Sam ' ,
3434 ],
3535 ];
3636
4444 $ data = [
4545 'statusCode ' => 200 ,
4646 'headers ' => [
47- 'Content-Type ' => 'application/json '
47+ 'Content-Type ' => 'application/json ' ,
4848 ],
4949 'data ' => [
50- 'name ' => 'Sam '
50+ 'name ' => 'Sam ' ,
5151 ],
5252 ];
5353
Original file line number Diff line number Diff line change 11<?php
22
3+ use Sammyjo20 \Saloon \Http \MockResponse ;
34use Sammyjo20 \Saloon \Clients \MockClient ;
4- use Sammyjo20 \Saloon \Exceptions \DirectoryNotFoundException ;
5- use Sammyjo20 \Saloon \Exceptions \FixtureMissingException ;
65use Sammyjo20 \Saloon \Helpers \MockConfig ;
7- use Sammyjo20 \Saloon \Http \ MockResponse ;
6+ use Sammyjo20 \Saloon \Exceptions \ FixtureMissingException ;
87use Sammyjo20 \Saloon \Tests \Fixtures \Requests \UserRequest ;
8+ use Sammyjo20 \Saloon \Exceptions \DirectoryNotFoundException ;
99
1010test ('you can change the default fixture path ' , function () {
1111 expect (MockConfig::getFixturePath ())->toEqual ('tests/Fixtures/Saloon ' );
3636
3737 UserRequest::make ()->send ($ mockClient );
3838})->throws (FixtureMissingException::class, 'The fixture "example.json" could not be found in storage. ' );
39-
40-
Original file line number Diff line number Diff line change 11<?php
22
33use League \Flysystem \Filesystem ;
4+ use Sammyjo20 \Saloon \Helpers \Storage ;
45use League \Flysystem \Local \LocalFilesystemAdapter ;
56use Sammyjo20 \Saloon \Exceptions \DirectoryNotFoundException ;
6- use Sammyjo20 \Saloon \Helpers \Storage ;
77
88test ('it will throw an exception if the base directory does not exist ' , function () {
99 new Storage ('example ' );
You can’t perform that action at this time.
0 commit comments