Esempio n. 1
0
 /**
  * @testdox Can not reset read only table
  */
 public function testResetReadOnlyTable()
 {
     $select = new Select('foo');
     $this->setExpectedException('\\SphinxSearch\\Db\\Sql\\Exception\\InvalidArgumentException');
     $select->reset(Select::TABLE);
 }
 public function testGroupWithCompoundName()
 {
     $adapter = $this->adapter;
     $adapter->query('TRUNCATE RTINDEX foo', $adapter::QUERY_MODE_EXECUTE);
     $indexer = new Indexer($adapter);
     $indexer->insert('foo', ['id' => 11, 'short' => 'hello world', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'c1' => 10, 'c2' => 100, 'c3' => 1000, 'f1' => pi()], true);
     $indexer->insert('foo', ['id' => 12, 'short' => 'hello world 2', 'text' => 'Lorem ipsum dolor sit amet ...', 'c1' => 10, 'c2' => 100, 'c3' => 2000, 'f1' => pi()], true);
     $select30 = new Select();
     $select30->from('foo')->group('c1.d2');
     $search = new Search($adapter);
     $this->setExpectedException('\\Zend\\Db\\Adapter\\Exception\\InvalidQueryException');
     $search->searchWith($select30);
     $adapter->query('TRUNCATE RTINDEX foo', $adapter::QUERY_MODE_EXECUTE);
 }