mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-30 02:37:58 +08:00
Added test cases.
This commit is contained in:
parent
500d83af5e
commit
4fa2e2367c
@ -1,5 +1,9 @@
|
|||||||
# v2.1.15 - TBD
|
# v2.1.15 - TBD
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- [#3484](https://github.com/hyperf/hyperf/pull/3484) Added methods `withMax()` `withMin()` `withSum()` and `withAvg()`.
|
||||||
|
|
||||||
# v2.1.14 - 2021-04-12
|
# v2.1.14 - 2021-04-12
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
# v2.1.14 - 2021-04-12
|
# v2.1.14 - 2021-04-12
|
||||||
|
|
||||||
## Fixed
|
## 修复
|
||||||
|
|
||||||
- [#3465](https://github.com/hyperf/hyperf/pull/3465) 修复协程风格下,`WebSocket` 服务不支持配置多个端口的问题。
|
- [#3465](https://github.com/hyperf/hyperf/pull/3465) 修复协程风格下,`WebSocket` 服务不支持配置多个端口的问题。
|
||||||
- [#3467](https://github.com/hyperf/hyperf/pull/3467) 修复协程风格下,`WebSocket` 服务无法正常释放连接池的问题。
|
- [#3467](https://github.com/hyperf/hyperf/pull/3467) 修复协程风格下,`WebSocket` 服务无法正常释放连接池的问题。
|
||||||
|
|
||||||
## Added
|
## 新增
|
||||||
|
|
||||||
- [#3472](https://github.com/hyperf/hyperf/pull/3472) 新增方法 `Sender::getResponse()`,可以在协程风格的 `WebSocket` 服务里,获得与 `fd` 一一对应的 `Response` 对象。
|
- [#3472](https://github.com/hyperf/hyperf/pull/3472) 新增方法 `Sender::getResponse()`,可以在协程风格的 `WebSocket` 服务里,获得与 `fd` 一一对应的 `Response` 对象。
|
||||||
|
|
||||||
|
@ -336,6 +336,8 @@ abstract class Relation
|
|||||||
/**
|
/**
|
||||||
* Get a relationship join table hash.
|
* Get a relationship join table hash.
|
||||||
*
|
*
|
||||||
|
* For safety, The relationship ensures this method is only used in the same coroutine.
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getRelationCountHash(bool $incrementJoinCount = true)
|
public function getRelationCountHash(bool $incrementJoinCount = true)
|
||||||
|
@ -681,6 +681,15 @@ class ModelBuilderTest extends TestCase
|
|||||||
$this->assertEquals('select "model_builder_test_model_parent_stubs".*, (select count(*) from "model_builder_test_model_close_related_stubs" where "model_builder_test_model_parent_stubs"."foo_id" = "model_builder_test_model_close_related_stubs"."id") as "foo_count" from "model_builder_test_model_parent_stubs"', $builder->toSql());
|
$this->assertEquals('select "model_builder_test_model_parent_stubs".*, (select count(*) from "model_builder_test_model_close_related_stubs" where "model_builder_test_model_parent_stubs"."foo_id" = "model_builder_test_model_close_related_stubs"."id") as "foo_count" from "model_builder_test_model_parent_stubs"', $builder->toSql());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testWithMax()
|
||||||
|
{
|
||||||
|
$model = new ModelBuilderTestModelParentStub();
|
||||||
|
|
||||||
|
$builder = $model->withMax('foo', 'id');
|
||||||
|
|
||||||
|
$this->assertEquals('select "model_builder_test_model_parent_stubs".*, (select max("model_builder_test_model_close_related_stubs"."id") from "model_builder_test_model_close_related_stubs" where "model_builder_test_model_parent_stubs"."foo_id" = "model_builder_test_model_close_related_stubs"."id") as "foo_max_id" from "model_builder_test_model_parent_stubs"', $builder->toSql());
|
||||||
|
}
|
||||||
|
|
||||||
public function testWithCountAndSelect()
|
public function testWithCountAndSelect()
|
||||||
{
|
{
|
||||||
$model = new ModelBuilderTestModelParentStub();
|
$model = new ModelBuilderTestModelParentStub();
|
||||||
|
Loading…
Reference in New Issue
Block a user