bbrothers /
Muzzle
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Muzzle\Assertions; |
||
| 4 | |||
| 5 | use GuzzleHttp\Psr7\Uri; |
||
| 6 | use GuzzleHttp\Psr7\UriResolver; |
||
| 7 | use Muzzle\Messages\Transaction; |
||
| 8 | use Muzzle\Muzzle; |
||
| 9 | |||
| 10 | class UriPathMatches implements Assertion |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var Muzzle |
||
| 15 | */ |
||
| 16 | private $muzzle; |
||
| 17 | |||
| 18 | public function __construct(Muzzle $muzzle) |
||
| 19 | { |
||
| 20 | |||
| 21 | $this->muzzle = $muzzle; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function assert(Transaction $actual, Transaction $expected) : void |
||
| 25 | { |
||
| 26 | |||
| 27 | $actual->request()->assertUriPath( |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 28 | UriResolver::resolve( |
||
| 29 | $this->muzzle->getConfig('base_uri') ?: new Uri, |
||
| 30 | $expected->request()->getUri() |
||
| 31 | )->getPath() |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |