コード例 #1
0
 public function testAddOptionWithInvalidKeyThrowsException()
 {
     $instance = new Table('Foo');
     $this->setExpectedException('RuntimeException');
     $instance->addOption('fields', array('foobar'));
 }
コード例 #2
0
 private function newFulltextSearchTable()
 {
     // FT_SEARCH_TABLE
     // TEXT and BLOB is stored off the table with the table just having a pointer
     // VARCHAR is stored inline with the table
     $table = new Table(SQLStore::FT_SEARCH_TABLE);
     $table->addColumn('s_id', array(FieldType::FIELD_ID, 'NOT NULL'));
     $table->addColumn('p_id', array(FieldType::FIELD_ID, 'NOT NULL'));
     $table->addColumn('o_text', FieldType::TYPE_TEXT);
     $table->addColumn('o_sort', FieldType::FIELD_TITLE);
     $table->addIndex('s_id');
     $table->addIndex('p_id');
     $table->addIndex('o_sort');
     $table->addIndex(array('o_text', 'FULLTEXT'));
     $table->addOption('ftSearchOptions', $GLOBALS['smwgFulltextSearchTableOptions']);
     return $table;
 }