Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function testInsert(array $config) |
||
18 | { |
||
19 | Coroutine\create(function () use ($config) { |
||
20 | $factory = new ManagerFactory(); |
||
21 | $database = $factory->create($config); |
||
22 | |||
23 | $time = time(); |
||
24 | |||
25 | yield $database |
||
26 | ->table("test") |
||
27 | ->insert(["text" => $time]); |
||
28 | |||
29 | $row = ( |
||
30 | yield $database |
||
|
|||
31 | ->table("test") |
||
32 | ->select() |
||
33 | ->where("text = ?", $time) |
||
34 | ->first() |
||
35 | ); |
||
36 | |||
37 | $this->assertEqualsAfterDelay(0.5, $row["text"], $time); |
||
38 | })->done(); |
||
39 | |||
40 | Loop\run(); |
||
41 | } |
||
42 | |||
92 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: