| Conditions | 1 |
| Paths | 1 |
| Total Lines | 40 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | 13 | public function setup() |
|
| 35 | { |
||
| 36 | 13 | $this->client->evaluate('box.schema.create_space(...)', $this->space, [ |
|
| 37 | 13 | 'engine' => $this->engine, |
|
| 38 | 'if_not_exists' => true, |
||
| 39 | 'format' => [ |
||
| 40 | [ |
||
| 41 | 'name' => 'key', |
||
| 42 | 'type' => 'string', |
||
| 43 | ], |
||
| 44 | [ |
||
| 45 | 'name' => 'token', |
||
| 46 | 'type' => 'string', |
||
| 47 | ], |
||
| 48 | [ |
||
| 49 | 'name' => 'expire', |
||
| 50 | 'type' => 'number', |
||
| 51 | ], |
||
| 52 | ], |
||
| 53 | ]); |
||
| 54 | |||
| 55 | 13 | $this->client->call("box.space.{$this->space}:create_index", "key", [ |
|
| 56 | 13 | 'type' => 'hash', |
|
| 57 | 'if_not_exists' => true, |
||
| 58 | 'unique' => true, |
||
| 59 | 'parts' => ['key'], |
||
| 60 | ]); |
||
| 61 | |||
| 62 | 13 | $this->client->call("box.space.{$this->space}:create_index", "token_key", [ |
|
| 63 | 13 | 'type' => 'hash', |
|
| 64 | 'if_not_exists' => true, |
||
| 65 | 'unique' => true, |
||
| 66 | 'parts' => ['token', 'key'], |
||
| 67 | ]); |
||
| 68 | |||
| 69 | 13 | $this->client->call("box.space.{$this->space}:create_index", "expire", [ |
|
| 70 | 13 | 'type' => 'tree', |
|
| 71 | 'if_not_exists' => true, |
||
| 72 | 'unique' => false, |
||
| 73 | 'parts' => ['expire'], |
||
| 74 | ]); |
||
| 91 |