Test Failed
Push — master ( eef45f...e0c5e8 )
by P.R.
04:35
created

RowsWithKeyWithLobTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace SetBased\Stratum\MySql\Test;
5
6
/**
7
 * Test cases for stored routines with designation type rows_with_key LOBs.
8
 */
9
class RowsWithKeyWithLobTest extends DataLayerTestCase
10
{
11
  //--------------------------------------------------------------------------------------------------------------------
12
  /**
13
   * Stored routine with designation type rows_with_key must return multi dimensional array.
14
   */
15
  public function test1()
16
  {
17
    $rows = $this->dataLayer->tstTestRowsWithKey1WithLob(100, 'blob');
18
    self::assertIsArray($rows);
19
    self::assertCount(1, $rows);
20
21
    self::assertArrayHasKey('a', $rows);
22
    self::assertArrayHasKey('b', $rows['a']);
23
24
    self::assertNotCount(0, $rows['a']['b']);
25
26
    self::assertArrayHasKey('c1', $rows['a']['b']);
27
28
    self::assertNotCount(0, $rows['a']['b']['c1']);
29
  }
30
31
  //--------------------------------------------------------------------------------------------------------------------
32
  /**
33
   * Stored routine with designation type rows_with_key must return empty array when no rwos are selected.
34
   */
35
  public function test2()
36
  {
37
    $rows = $this->dataLayer->tstTestRowsWithKey1WithLob(0, 'blob');
38
    self::assertIsArray($rows);
39
    self::assertCount(0, $rows);
40
41
  }
42
43
  //--------------------------------------------------------------------------------------------------------------------
44
}
45
46
//----------------------------------------------------------------------------------------------------------------------
47
48