Example #1
0
 /**
  * @param Adapter $adapter
  * @dataProvider adapterProvider
  */
 public function testSetLoggerWithInvalidQuery(Adapter $adapter)
 {
     $this->setExpectedException(Exception\RuntimeException::class);
     $logger = $this->getMock(\Psr\Log\NullLogger::class, array('debug', 'error'));
     $logger->expects($this->once())->method('debug');
     $logger->expects($this->once())->method('error');
     $adapter->setLogger($logger);
     $adapter->query('SELECT WETRW#$Twe4gtwefr');
 }
Example #2
0
 /**
  * @param Adapter $adapter
  * @dataProvider adapterProvider
  */
 public function testInvalidResultMode(Adapter $adapter)
 {
     $this->setExpectedException(Exception\InvalidArgumentException::class);
     $select = new SelectQuery('SELECT * FROM fixture1 ORDER BY id ASC LIMIT 1');
     $result = $adapter->query($select);
     $result->setResultMode(1488);
 }