release 1.0.0

This commit is contained in:
Alex
2025-08-13 22:00:54 +03:00
parent 17acd6de67
commit 0bb13b3a7c
4 changed files with 31 additions and 9 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ use RuntimeException;
*/
class Api
{
public const string LIBRARY_VERSION = '0.9.0';
public const string LIBRARY_VERSION = '1.0.0';
public const string API_VERSION = '0.0.6';
-1
View File
@@ -171,7 +171,6 @@ class MaxBotServiceProvider extends ServiceProvider
* Get the services provided by the provider.
*
* @return array<int, string>
* @codeCoverageIgnore
*/
public function provides(): array
{
+1 -1
View File
@@ -37,7 +37,7 @@ return [
|
*/
'base_url' => env('MAXBOT_BASE_URL', 'https://botapi.max.ru'),
'api_version' => env('MAXBOT_API_VERSION', '0.0.6'),
'api_version' => env('MAXBOT_API_VERSION'),
/*
|--------------------------------------------------------------------------
+29 -6
View File
@@ -30,6 +30,7 @@ use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\UsesClass;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use ReflectionClass;
#[CoversClass(MaxBotServiceProvider::class)]
#[UsesClass(Api::class)]
@@ -104,7 +105,6 @@ final class MaxBotServiceProviderTest extends TestCase
$this->app->make(ClientApiInterface::class);
}
/**
* @return array<string, array{0: string, 1: class-string}>
*/
@@ -166,7 +166,7 @@ final class MaxBotServiceProviderTest extends TestCase
$client = $this->app->make(ClientApiInterface::class);
$this->assertInstanceOf(Client::class, $client);
$reflection = new \ReflectionClass($client);
$reflection = new ReflectionClass($client);
$accessTokenProp = $reflection->getProperty('accessToken');
$baseUrlProp = $reflection->getProperty('baseUrl');
@@ -188,7 +188,7 @@ final class MaxBotServiceProviderTest extends TestCase
/** @var Client $client */
$client = $this->app->make(ClientApiInterface::class);
$reflection = new \ReflectionClass($client);
$reflection = new ReflectionClass($client);
$loggerProp = $reflection->getProperty('logger');
$actualLogger = $loggerProp->getValue($client);
@@ -203,7 +203,7 @@ final class MaxBotServiceProviderTest extends TestCase
/** @var Client $client */
$client = $this->app->make(ClientApiInterface::class);
$reflection = new \ReflectionClass($client);
$reflection = new ReflectionClass($client);
$loggerProp = $reflection->getProperty('logger');
$actualLogger = $loggerProp->getValue($client);
@@ -217,7 +217,7 @@ final class MaxBotServiceProviderTest extends TestCase
$handler = $this->app->make(WebhookHandler::class);
$this->assertInstanceOf(WebhookHandler::class, $handler);
$reflection = new \ReflectionClass($handler);
$reflection = new ReflectionClass($handler);
$secretProp = $reflection->getProperty('secret');
$this->assertSame('test-secret', $secretProp->getValue($handler));
@@ -229,7 +229,7 @@ final class MaxBotServiceProviderTest extends TestCase
/** @var Api $api */
$api = $this->app->make(Api::class);
$reflection = new \ReflectionClass($api);
$reflection = new ReflectionClass($api);
$clientProp = $reflection->getProperty('client');
$factoryProp = $reflection->getProperty('modelFactory');
@@ -263,4 +263,27 @@ final class MaxBotServiceProviderTest extends TestCase
$this->assertArrayHasKey($signature, $commands);
$this->assertInstanceOf($class, $commands[$signature]);
}
#[Test]
public function providesMethod(): void
{
$provides = [
Api::class,
ClientApiInterface::class,
ModelFactory::class,
UpdateDispatcher::class,
WebhookHandler::class,
LongPollingHandler::class,
MaxBotManager::class,
'maxbot',
'maxbot.api',
'maxbot.client',
'maxbot.dispatcher',
'maxbot.webhook',
'maxbot.polling',
'maxbot.manager',
];
$this->assertSame($this->app->getProvider(MaxBotServiceProvider::class)->provides(), $provides);
}
}