ssaweb/appwrite-test-utils
最新稳定版本:v2.0.2
Composer 安装命令:
composer require ssaweb/appwrite-test-utils
包简介
Helpful classes to write your PHPUnit tests for Appwrite functions
README 文档
README
Classes to help you writing your PHPUnit tests for Appwrite functions
Why use a $context wrapper?
Personal needs that may be useful to someone else XD
Basically if you try to write a test to check the data sent to the json or send methods of Appwrite Functions' API like below:
$this->response = $this->createMock(stdClass::class); $this->response ->expects($this->once()) ->method('json') ->with($this->anything(), 201);
The code above will fail with the following message:
Trying to configure method "json" which cannot be configured because it does not exist, has not been specified, is final, or is static
Therefore, we need to add a type to that object, since Appwrite's SDK does not provide it to us, I've created this package to do so.
$this->response = $this->createMock(Response::class); $this->response ->expects($this->once()) ->method('json') ->with($this->anything(), 201);
now we've a typed $response object that can be evaluated =)
统计信息
- 总下载量: 666
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-28