/**
* @test
*/
public function shouldThrowExceptionOnExecutionError()
{
//given
Mock::when($this->pdoMock)->errorInfo()->thenReturn(array('HY000', '20102', 'Execution error'));
$executor = new PDOPreparedStatementExecutor();
//when
CatchException::when($executor)->createPDOStatement($this->dbMock, 'sql', array(), 'sql string');
//then
CatchException::assertThat()->isInstanceOf('\\Ouzo\\DbException');
}