New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement our own error handler for db2_prepare #273

Merged
merged 10 commits into from Nov 23, 2017

Make integration tests work on IBM i

  • Loading branch information...
akrabat committed Oct 13, 2017
commit 192d30da4f553dbe155194eaf397b8991a3d32af
@@ -64,7 +64,7 @@ public function testGetResource()
$statement = new Statement;
$statement->initialize($db2Resource);
$statement->prepare("SELECT 'foo'");
$statement->prepare("SELECT 'foo' FROM sysibm.sysdummy1");
$resource = $statement->getResource();
$this->assertEquals('DB2 Statement', get_resource_type($resource));
unset($resource, $db2Resource);
@@ -88,11 +88,10 @@ public function testPrepare()
/**
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
* @expectedException RuntimeException

This comment has been minimized.

@webimpress

webimpress Oct 14, 2017

Contributor

I would move it to function use, because right now it's not clear, which line should thrown that exception.

This comment has been minimized.

@akrabat

akrabat Oct 14, 2017

Member

@webimpress I can't - it doesn't work on the AS/400 when I do that. I have no idea why.

This comment has been minimized.

@webimpress

webimpress Oct 14, 2017

Contributor

Hm... so maybe exception is thrown not where you expecting it?

This comment has been minimized.

@akrabat

akrabat Oct 14, 2017

Member

It was a PHP error. I'll have another look when I'm next connected to that computer.

*/
public function testPrepareThrowsAnExceptionOnFailure()
{
$this->expectException(RuntimeException::class);
$db2Resource = db2_connect(
$this->variables['database'],
$this->variables['username'],
ProTip! Use n and p to navigate between commits in a pull request.