Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "4.43.1",
"cliVersion": "4.46.0",
"generatorName": "fernapi/fern-php-sdk",
"generatorVersion": "2.2.3",
"generatorConfig": {
Expand All @@ -14,12 +14,12 @@
},
"license": "MIT"
},
"enable-wire-tests": false,
"enable-wire-tests": true,
"propertyAccess": "public",
"packageName": "getbrevo/brevo-php",
"generateClientInterfaces": true,
"useDefaultRequestParameterValues": true
},
"originGitCommit": "7d08ac3fbe2aa66ba3d56077e8582739d530298b",
"sdkVersion": "4.0.11"
"originGitCommit": "f25a5c52b4f8c7fb0eab7532cf4d3032bce1c05c",
"sdkVersion": "4.0.12"
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "getbrevo/brevo-php",
"version": "4.0.11",
"version": "4.0.12",
"description": "Official PHP SDK for the Brevo API.",
"keywords": [
"brevo",
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<phpunit bootstrap="vendor/autoload.php">
<phpunit bootstrap="tests/Wire/bootstrap.php">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
</phpunit>
</phpunit>
4 changes: 2 additions & 2 deletions src/Brevo.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ public function __construct(
'api-key' => $apiKey,
'X-Fern-Language' => 'PHP',
'X-Fern-SDK-Name' => 'Brevo',
'X-Fern-SDK-Version' => '4.0.11',
'User-Agent' => 'getbrevo/brevo-php/4.0.11',
'X-Fern-SDK-Version' => '4.0.12',
'User-Agent' => 'getbrevo/brevo-php/4.0.12',
];

$this->options = $options ?? [];
Expand Down
14 changes: 7 additions & 7 deletions src/Ecommerce/Types/CreateBatchOrderResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

class CreateBatchOrderResponse extends JsonSerializableType
{
/**
* @var float $batchId Batch ID of the request
*/
#[JsonProperty('batchId')]
public float $batchId;

/**
* @var ?int $count Number of orders
*/
#[JsonProperty('count')]
public ?int $count;

/**
* @var float $batchId Batch ID of the request
*/
#[JsonProperty('batch_id')]
public float $batchId;

/**
* @param array{
* batchId: float,
Expand All @@ -28,8 +28,8 @@ class CreateBatchOrderResponse extends JsonSerializableType
public function __construct(
array $values,
) {
$this->batchId = $values['batchId'];
$this->count = $values['count'] ?? null;
$this->batchId = $values['batchId'];
}

/**
Expand Down
69 changes: 69 additions & 0 deletions tests/Wire/AccountWireTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace Brevo\Tests;

use Brevo\Tests\Wire\WireMockTestCase;
use Brevo\Brevo;
use Brevo\Account\Requests\GetAccountActivityRequest;

class AccountWireTest extends WireMockTestCase
{
/**
* @var Brevo $client
*/
private Brevo $client;

/**
*/
public function testGetAccount(): void {
$testId = 'account.get_account.0';
$this->client->account->getAccount(
[
'headers' => [
'X-Test-Id' => 'account.get_account.0',
],
],
);
$this->verifyRequestCount(
$testId,
"GET",
"/account",
null,
1
);
}

/**
*/
public function testGetAccountActivity(): void {
$testId = 'account.get_account_activity.0';
$this->client->account->getAccountActivity(
new GetAccountActivityRequest([]),
[
'headers' => [
'X-Test-Id' => 'account.get_account_activity.0',
],
],
);
$this->verifyRequestCount(
$testId,
"GET",
"/organization/activities",
null,
1
);
}

/**
*/
protected function setUp(): void {
parent::setUp();
$wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
$this->client = new Brevo(
apiKey: 'test-apiKey',
options: [
'baseUrl' => $wiremockUrl,
],
);
}
}
Loading
Loading