| @@ 89-100 (lines=12) @@ | ||
| 86 | 'title' => 'First Column'], $meta->columnInfo('first_column')); |
|
| 87 | } |
|
| 88 | ||
| 89 | public function testIntegerColumn() { |
|
| 90 | $meta = new Meta(); |
|
| 91 | $meta->column('first_column', 0); |
|
| 92 | ||
| 93 | $this->assertEquals([ |
|
| 94 | 'value' => 0, |
|
| 95 | 'type' => 'integer', |
|
| 96 | 'visible' => true, |
|
| 97 | 'title' => 'First Column'], $meta->columnInfo('first_column')); |
|
| 98 | ||
| 99 | $this->assertEquals(1, $meta->columnCount()); |
|
| 100 | } |
|
| 101 | ||
| 102 | public function testMultipleColumns() { |
|
| 103 | $meta = new Meta(); |
|
| @@ 109-119 (lines=11) @@ | ||
| 106 | ||
| 107 | $this->assertEquals(2, $meta->columnCount()); |
|
| 108 | } |
|
| 109 | public function testInvisibleColumn() { |
|
| 110 | $meta = new Meta(); |
|
| 111 | $meta->column('first_column', '', ['visible' => false]); |
|
| 112 | ||
| 113 | $this->assertEquals([ |
|
| 114 | 'value' => '', |
|
| 115 | 'type' => 'string', |
|
| 116 | 'visible' => false], $meta->columnInfo('first_column')); |
|
| 117 | ||
| 118 | $this->assertEquals(1, $meta->columnCount()); |
|
| 119 | } |
|
| 120 | public function testColumnWithOptions() { |
|
| 121 | $meta = new Meta(); |
|
| 122 | $meta->column('first_column', '', ['extra_option' => true]); |
|
| @@ 150-163 (lines=14) @@ | ||
| 147 | ||
| 148 | } |
|
| 149 | ||
| 150 | public function testSetPointData() { |
|
| 151 | $meta = new Meta(); |
|
| 152 | $meta |
|
| 153 | ->column('first_column') |
|
| 154 | ->setPoint('test') |
|
| 155 | ->set('first_column', 'test value'); |
|
| 156 | ||
| 157 | $this->assertEquals(['first_column' => [ |
|
| 158 | 'value' => 'test value', |
|
| 159 | 'type' => 'string', |
|
| 160 | 'visible' => true, |
|
| 161 | 'title' => 'First Column' |
|
| 162 | ]], $meta->getPoint()); |
|
| 163 | } |
|
| 164 | ||
| 165 | public function testSetInvalidPointData() { |
|
| 166 | $meta = new Meta(); |
|