/** * @test * @see http://forge.typo3.org/issues/21718 */ public function cachingFrameworkQueryIsRemapped() { $currentTime = time(); $table = 'cachingframework_cache_hash_tags'; $where = 'identifier IN (' . $this->subject->SELECTsubquery('identifier', 'cachingframework_cache_pages', 'crdate + lifetime < ' . $currentTime . ' AND lifetime > 0') . ')'; // Perform remapping (as in method exec_DELETEquery) $tableArray = $this->subject->_call('map_needMapping', $table); // Where clause: $whereParts = $this->subject->SQLparser->parseWhereClause($where); $this->subject->_callRef('map_sqlParts', $whereParts, $tableArray[0]['table']); $where = $this->subject->SQLparser->compileWhereClause($whereParts, FALSE); // Table name: if ($this->subject->mapping[$table]['mapTableName']) { $table = $this->subject->mapping[$table]['mapTableName']; } $result = $this->subject->DELETEquery($table, $where); $expected = 'DELETE FROM "cf_cache_hash_tags" WHERE "identifier" IN ('; $expected .= 'SELECT "identifier" FROM "cf_cache_pages" WHERE "crdate"+"lifetime" < ' . $currentTime . ' AND "lifetime" > 0'; $expected .= ')'; $this->assertEquals($expected, $this->cleanSql($result)); }