| Total Complexity | 6 | 
| Total Lines | 57 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 11 | class GetTest extends BaseTestCase | ||
| 12 | { | ||
| 13 | public function setUp() | ||
| 14 |     { | ||
| 15 | parent::setUp(); | ||
| 16 | |||
| 17 |         if (!\in_array('tabletest', $this->r()->db()->tableList()->run()->getData(), true)) { | ||
|  | |||
| 18 |             $this->r()->db()->tableCreate('tabletest')->run(); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | public function tearDown() | ||
| 29 | } | ||
| 30 | |||
| 31 | /** | ||
| 32 | * @return void | ||
| 33 | * @throws \Exception | ||
| 34 | */ | ||
| 35 | public function testGet(): void | ||
| 36 |     { | ||
| 37 | $this->r() | ||
| 38 |             ->table('tabletest') | ||
| 39 | ->insert([ | ||
| 40 | [ | ||
| 41 | 'id' => 'foo', | ||
| 42 | ], | ||
| 43 | ]) | ||
| 44 | ->run(); | ||
| 45 | |||
| 46 | /** @var ResponseInterface $res */ | ||
| 47 | $res = $this->r() | ||
| 48 |             ->table('tabletest') | ||
| 49 |             ->get('foo') | ||
| 50 | ->run(); | ||
| 51 | |||
| 52 | $this->assertEquals(['id' => 'foo'], $res->getData()); | ||
| 53 | } | ||
| 54 | |||
| 55 | /** | ||
| 56 | * @return void | ||
| 57 | * @throws \Exception | ||
| 58 | */ | ||
| 59 | public function testGetNonExistingDocument(): void | ||
| 68 | } | ||
| 69 | } | ||
| 70 |