/** * @expectedException \Exception * @expectedExceptionMessage Table 'log_foo_bar_baz' can't be used for segmentation */ public function test_addTableToJoin_shouldCheckIfTableCanBeUsedForSegmentation() { $table = 'log_foo_bar_baz'; $this->assertFalse($this->tables->hasJoinedTable($table)); $this->tables->addTableToJoin($table); $this->assertTrue($this->tables->hasJoinedTable($table)); }
private function addMissingTablesNeededForJoins() { foreach ($this->tables as $index => $table) { if (is_array($table)) { continue; } $logTable = $this->tables->getLogTable($table); if (!$logTable->getColumnToJoinOnIdVisit()) { $tableNameToJoin = $logTable->getLinkTableToBeAbleToJoinOnVisit(); if ($index > 0 && !$this->tables->hasJoinedTable($tableNameToJoin)) { $this->tables->addTableToJoin($tableNameToJoin); } if ($this->tables->hasJoinedTable($tableNameToJoin)) { $this->generateNonVisitJoins($table, $tableNameToJoin, $index); } } } }