diff --git a/tests/Store/PostgresDriver/PostgresCursorTest.phpt b/tests/Store/PostgresDriver/PostgresCursorTest.phpt new file mode 100644 index 0000000000000000000000000000000000000000..ada9cac791f4e3ef565a7d6ba9b5325edd150431 --- /dev/null +++ b/tests/Store/PostgresDriver/PostgresCursorTest.phpt @@ -0,0 +1,49 @@ +<?php +/** + * @testCase + */ + +namespace Grifart\Mappi\Tests\Store\Store\PostgresDriver; + +use Dibi\DriverException; +use Grifart\Mappi\Store\PostgresDriver\ArrayCursorDriver; +use Grifart\Mappi\Store\PostgresDriver\Cursor; +use Grifart\Mappi\Store\PostgresDriver\CursorFactory; +use Grifart\Mappi\Store\PostgresDriver\ICursor; +use Grifart\Mappi\Store\PostgresDriver\ICursorDriver; +use Tester\Environment; + +require_once __DIR__ . "/../../bootstrap.php"; +require_once __DIR__ . "/ICursorTest.php"; + +class PostgresCursorTest extends ICursorTest +{ + /** @var ICursor */ + protected $uut; + + protected function setUp() + { + global $connection, $SQL_thousandRowsAscending; + try{ + $connection->begin(); + + $factory = new CursorFactory($connection); + $this->uut = $factory->create($SQL_thousandRowsAscending, true); + } catch (DriverException $e) { + Environment::skip("It looks like you haven't properly set-up dibi connection to PostgreSQL. Check tests/bootstrap.php"); + } + + parent::setUp(); + } + + public function tearDown() + { + global $connection; + $connection->rollback(); + + parent::tearDown(); + } + +} + +(new PostgresCursorTest())->run();