| Total Complexity | 1 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class RowsTest extends CommonTestClass |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @throws ConnectException |
||
| 18 | * @throws TableException |
||
| 19 | */ |
||
| 20 | public function testFunc(): void |
||
| 21 | { |
||
| 22 | $lib = new Table(); |
||
| 23 | |||
| 24 | // basic way via call |
||
| 25 | // add class "shady" when cell "name" contains "mno" |
||
| 26 | $lib->rowClass('shady', new Table\Rules\Exact('mno'), 'name'); |
||
| 27 | |||
| 28 | // another way via magical methods |
||
| 29 | $lib->rowId('white'); // call function name... - it ends in Styles |
||
| 30 | $lib->rowName('dark', new Table\Rules\Exact('pqr')); |
||
| 31 | |||
| 32 | $lib->addColumn('id', new Columns\Basic('id')); |
||
| 33 | $lib->addColumn('name', new Columns\Basic('name')); |
||
| 34 | $lib->addColumn('title', new Columns\Basic('desc')); |
||
| 35 | |||
| 36 | $lib->addDataSetConnector(new Connector($this->basicData())); |
||
| 37 | |||
| 38 | $lib->translateData(); |
||
| 39 | // just try something! |
||
| 40 | $this->assertEquals(9, $lib->rowCount()); |
||
| 41 | $this->assertEquals(3, $lib->colCount()); |
||
| 42 | } |
||
| 44 |