Commit b0644080 authored by Steve Müller's avatar Steve Müller

add connection empty insert test

parent db4b370a
......@@ -8,6 +8,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Events;
use Doctrine\Tests\Mocks\ConnectionMock;
use Doctrine\Tests\Mocks\DriverConnectionMock;
class ConnectionTest extends \Doctrine\Tests\DbalTestCase
......@@ -275,4 +276,24 @@ SQLSTATE[HY000]: General error: 1 near \"MUUHAAAAHAAAA\"");
$this->assertFalse($conn->isTransactionActive());
}
}
\ No newline at end of file
public function testEmptyInsert()
{
$driverMock = $this->getMock('Doctrine\DBAL\Driver');
$driverMock->expects($this->any())
->method('connect')
->will($this->returnValue(new DriverConnectionMock()));
$conn = $this->getMockBuilder('Doctrine\DBAL\Connection')
->setMethods(array('executeUpdate'))
->setConstructorArgs(array(array('platform' => new Mocks\MockPlatform()), $driverMock))
->getMock();
$conn->expects($this->once())
->method('executeUpdate')
->with('INSERT INTO footable () VALUES ()');
$conn->insert('footable', array());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment