Skip to content

Commit 0bb13b3

Browse files
committed
release 1.0.0
1 parent 17acd6d commit 0bb13b3

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

src/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
*/
4848
class Api
4949
{
50-
public const string LIBRARY_VERSION = '0.9.0';
50+
public const string LIBRARY_VERSION = '1.0.0';
5151

5252
public const string API_VERSION = '0.0.6';
5353

src/Laravel/MaxBotServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ public function boot(): void
171171
* Get the services provided by the provider.
172172
*
173173
* @return array<int, string>
174-
* @codeCoverageIgnore
175174
*/
176175
public function provides(): array
177176
{

src/Laravel/config/maxbot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
|
3838
*/
3939
'base_url' => env('MAXBOT_BASE_URL', 'https://botapi.max.ru'),
40-
'api_version' => env('MAXBOT_API_VERSION', '0.0.6'),
40+
'api_version' => env('MAXBOT_API_VERSION'),
4141

4242
/*
4343
|--------------------------------------------------------------------------

tests/Laravel/MaxBotServiceProviderTest.php

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use PHPUnit\Framework\Attributes\UsesClass;
3131
use Psr\Log\LoggerInterface;
3232
use Psr\Log\NullLogger;
33+
use ReflectionClass;
3334

3435
#[CoversClass(MaxBotServiceProvider::class)]
3536
#[UsesClass(Api::class)]
@@ -104,7 +105,6 @@ public function itThrowsExceptionWhenGuzzleIsMissing(): void
104105
$this->app->make(ClientApiInterface::class);
105106
}
106107

107-
108108
/**
109109
* @return array<string, array{0: string, 1: class-string}>
110110
*/
@@ -166,7 +166,7 @@ public function clientIsConfiguredCorrectlyFromConfig(): void
166166
$client = $this->app->make(ClientApiInterface::class);
167167
$this->assertInstanceOf(Client::class, $client);
168168

169-
$reflection = new \ReflectionClass($client);
169+
$reflection = new ReflectionClass($client);
170170

171171
$accessTokenProp = $reflection->getProperty('accessToken');
172172
$baseUrlProp = $reflection->getProperty('baseUrl');
@@ -188,7 +188,7 @@ public function clientIsConfiguredWithApplicationLoggerWhenLoggingIsEnabled(): v
188188
/** @var Client $client */
189189
$client = $this->app->make(ClientApiInterface::class);
190190

191-
$reflection = new \ReflectionClass($client);
191+
$reflection = new ReflectionClass($client);
192192
$loggerProp = $reflection->getProperty('logger');
193193
$actualLogger = $loggerProp->getValue($client);
194194

@@ -203,7 +203,7 @@ public function clientIsConfiguredWithNullLoggerWhenLoggingIsDisabled(): void
203203
/** @var Client $client */
204204
$client = $this->app->make(ClientApiInterface::class);
205205

206-
$reflection = new \ReflectionClass($client);
206+
$reflection = new ReflectionClass($client);
207207
$loggerProp = $reflection->getProperty('logger');
208208
$actualLogger = $loggerProp->getValue($client);
209209

@@ -217,7 +217,7 @@ public function webhookHandlerIsConfiguredWithSecretFromConfig(): void
217217
$handler = $this->app->make(WebhookHandler::class);
218218
$this->assertInstanceOf(WebhookHandler::class, $handler);
219219

220-
$reflection = new \ReflectionClass($handler);
220+
$reflection = new ReflectionClass($handler);
221221
$secretProp = $reflection->getProperty('secret');
222222

223223
$this->assertSame('test-secret', $secretProp->getValue($handler));
@@ -229,7 +229,7 @@ public function apiIsCreatedWithAllDependenciesFromContainer(): void
229229
/** @var Api $api */
230230
$api = $this->app->make(Api::class);
231231

232-
$reflection = new \ReflectionClass($api);
232+
$reflection = new ReflectionClass($api);
233233

234234
$clientProp = $reflection->getProperty('client');
235235
$factoryProp = $reflection->getProperty('modelFactory');
@@ -263,4 +263,27 @@ public function bootMethodRegistersCommandsInConsole(string $class, string $sign
263263
$this->assertArrayHasKey($signature, $commands);
264264
$this->assertInstanceOf($class, $commands[$signature]);
265265
}
266+
267+
#[Test]
268+
public function providesMethod(): void
269+
{
270+
$provides = [
271+
Api::class,
272+
ClientApiInterface::class,
273+
ModelFactory::class,
274+
UpdateDispatcher::class,
275+
WebhookHandler::class,
276+
LongPollingHandler::class,
277+
MaxBotManager::class,
278+
'maxbot',
279+
'maxbot.api',
280+
'maxbot.client',
281+
'maxbot.dispatcher',
282+
'maxbot.webhook',
283+
'maxbot.polling',
284+
'maxbot.manager',
285+
];
286+
287+
$this->assertSame($this->app->getProvider(MaxBotServiceProvider::class)->provides(), $provides);
288+
}
266289
}

0 commit comments

Comments
 (0)