rackbeat / laravel-client
Laravel PHP 客户端库,用于我们的API
dev-master
2022-08-01 04:40 UTC
Requires
- php: ^7.4
- ext-json: *
- guzzlehttp/guzzle: ^6.5|^7.0.1
- laravel/framework: ^6.0|^7.0|^8.0
- nesbot/carbon: ^1.26.3 || ^2.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^7.5|^8.0
This package is auto-updated.
Last update: 2024-08-29 05:30:41 UTC
README
**尚未准备好!**
API Laravel SDK
安装
只需使用composer即可,一切就绪!
composer require rackbeat/laravel-client
使用
即将推出...
测试
API类附带了一些模拟工具。您可以模拟响应或仅断言端点是否被调用。
断言已调用
// Set up the API class to use mocking \Rackbeat\API::mock(); // Has not been called yet \Rackbeat\API::assertNotCalled( 'get', '/lots' ); // Make a API call to GET /lots \Rackbeat\API::lots()->index(); // Has now been called \Rackbeat\API::assertCalled( 'get', '/lots' );
模拟响应
// Set up the API class to use mocking \Rackbeat\API::mock(); \Rackbeat\API::mockResponse('GET', '/lots', 'no lots'); // Make a API call to GET /lots \Rackbeat\API::lots()->index(); // Assert that the response was 'no lots' \Rackbeat\API::assertResponded( 'get', '/lots', 'no lots' );
贡献者
...
要求
- PHP >= 7.4
- Laravel >= 6.0