public function testDuplicateTableStructureVirtual() { $db = new DatabaseSqliteStandalone(':memory:'); if ($db->getFulltextSearchModule() != 'FTS3') { $this->markTestSkipped('FTS3 not supported, cannot create virtual tables'); } $db->query('CREATE VIRTUAL TABLE "foo" USING FTS3(foobar)'); $db->duplicateTableStructure('foo', 'bar'); $this->assertEquals('CREATE VIRTUAL TABLE "bar" USING FTS3(foobar)', $db->selectField('sqlite_master', 'sql', array('name' => 'bar')), 'Duplication of virtual tables'); $db->duplicateTableStructure('foo', 'baz', true); $this->assertEquals('CREATE VIRTUAL TABLE "baz" USING FTS3(foobar)', $db->selectField('sqlite_master', 'sql', array('name' => 'baz')), "Can't create temporary virtual tables, should fall back to non-temporary duplication"); }