Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Fix remaining issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 14, 2020
1 parent a36126d commit 7413e41
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/020_ResponseErrorHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/** @var \CommonSDK\Contracts\Request $request */
/** @var \CommonSDK\Contracts\Response $response */
$request = new \YDeliverySDK\Requests\DeliveryServicesRequest();
$request->setCabinetId(1);
$request->cabinetId = 1;

/*
* Случай ошибки авторизации с ошибочным токеном.
Expand Down Expand Up @@ -75,7 +75,7 @@
* Случай отсутствующего параметра.
*/
$request = new \YDeliverySDK\Requests\WithdrawIntervalsRequest();
$request->setDateObject(new DateTime('next Monday'));
$request->date = new DateTime('next Monday');

$response = $client->sendWithdrawIntervalsRequest($request);

Expand Down
4 changes: 2 additions & 2 deletions src/Responses/Types/DeliveryOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/**
* @property-read int $tariffId Идентификатор тарифа.
* @property-read string $tariffName Название тарифа.
* @property-read string|null $tariffName Название тарифа.
* @property-read Cost $cost Информация о стоимости заказа.
* @property-read Delivery $delivery Информация о доставке.
* @property-read int[] $pickupPointIds Идентификаторы пунктов выдачи заказов (для доставки в ПВЗ и почтой).
Expand Down Expand Up @@ -68,7 +68,7 @@ final class DeliveryOption
/**
* @JMS\Type("string")
*
* @var string
* @var string|null
*/
private $tariffName;

Expand Down
1 change: 1 addition & 0 deletions src/Responses/Types/DeliveryOption/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use YDeliverySDK\Common\Concerns\NamedEntity;

/**
* @property-read int $id
* @property-read string $code
* @property-read string $name
* @property-read string $partnerType
Expand Down
7 changes: 4 additions & 3 deletions tests/Integration/ErrorsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

namespace Tests\YDeliverySDK\Integration;

use YDeliverySDK\Client;

/** @psalm-suppress TypeDoesNotContainType */
if (false) {
include 'examples/020_ResponseErrorHandling.php';
Expand All @@ -47,12 +49,11 @@ final class ErrorsTest extends TestCase
*/
public function test_error_handling_with_invalid_token()
{
$request = new \YDeliverySDK\Requests\DeliveryServicesRequest();

$builder = new \YDeliverySDK\ClientBuilder();
$builder->setToken('invalid');
$client = $builder->build();

/** @var Client $client */
$request = new \YDeliverySDK\Requests\DeliveryServicesRequest();
$response = $client->sendDeliveryServicesRequest($request);

$this->assertTrue($response->hasErrors());
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/ImportIntervalsRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function test_successful_request()
break;
}

$this->assertNotNull($partner);

// Для него получим расписание доставки.
$request = new ImportIntervalsRequest();
$request->date = new \DateTime('next Monday');
Expand Down

0 comments on commit 7413e41

Please sign in to comment.