2009-05-29 01:34:35 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\DBAL\Functional\Schema;
|
|
|
|
|
|
|
|
use Doctrine\DBAL\Schema;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../../../TestInit.php';
|
|
|
|
|
2009-06-15 22:25:47 +04:00
|
|
|
class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
|
2009-05-29 01:34:35 +04:00
|
|
|
{
|
|
|
|
public function testListTableConstraints()
|
|
|
|
{
|
2009-05-30 06:27:50 +04:00
|
|
|
$this->createTestTable('list_table_constraints_test');
|
2009-05-29 01:34:35 +04:00
|
|
|
$tableConstraints = $this->_sm->listTableConstraints('list_table_constraints_test');
|
|
|
|
$this->assertEquals(array('list_table_constraints_test_pkey'), $tableConstraints);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testListUsers()
|
|
|
|
{
|
|
|
|
$users = $this->_sm->listUsers();
|
|
|
|
$this->assertEquals(true, is_array($users));
|
|
|
|
$params = $this->_conn->getParams();
|
|
|
|
$testUser = $params['user'];
|
|
|
|
$found = false;
|
|
|
|
foreach ($users as $user) {
|
|
|
|
if ($user['user'] == $testUser) {
|
|
|
|
$found = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->assertEquals(true, $found);
|
|
|
|
}
|
|
|
|
|
2009-11-03 19:56:05 +03:00
|
|
|
protected function getCreateExampleViewSql()
|
2009-05-29 01:34:35 +04:00
|
|
|
{
|
2009-11-03 19:56:05 +03:00
|
|
|
return 'SELECT usename, passwd FROM pg_user';
|
2009-05-29 01:34:35 +04:00
|
|
|
}
|
|
|
|
}
|