Commit 95b5bc1a authored by zYne's avatar zYne

--no commit message

--no commit message
parent dbd49e93
...@@ -30,134 +30,186 @@ ...@@ -30,134 +30,186 @@
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Revision$
*/ */
class Doctrine_Connection_Pgsql_TestCase extends Doctrine_UnitTestCase { class Doctrine_Connection_Pgsql_TestCase extends Doctrine_UnitTestCase
public function testNoSuchTableErrorIsSupported() { {
public function testNoSuchTableErrorIsSupported()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'table test does not exist'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'table test does not exist')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE);
} }
public function testNoSuchTableErrorIsSupported2() {
public function testNoSuchTableErrorIsSupported2()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'relation does not exist'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'relation does not exist')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE);
} }
public function testNoSuchTableErrorIsSupported3() {
public function testNoSuchTableErrorIsSupported3()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'sequence does not exist'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'sequence does not exist')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE);
} }
public function testNoSuchTableErrorIsSupported4() {
public function testNoSuchTableErrorIsSupported4()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'class xx not found'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'class xx not found')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE);
} }
public function testSyntaxErrorIsSupported() {
public function testSyntaxErrorIsSupported()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'parser: parse error at or near'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'parser: parse error at or near')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX);
} }
public function testSyntaxErrorIsSupported2() {
public function testSyntaxErrorIsSupported2()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'syntax error at'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'syntax error at')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX);
} }
public function testSyntaxErrorIsSupported3() {
public function testSyntaxErrorIsSupported3()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'column reference r.r is ambiguous'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'column reference r.r is ambiguous')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX);
} }
public function testInvalidNumberErrorIsSupported() {
public function testInvalidNumberErrorIsSupported()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'pg_atoi: error in somewhere: can\'t parse '))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'pg_atoi: error in somewhere: can\'t parse ')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER);
} }
public function testInvalidNumberErrorIsSupported2() {
public function testInvalidNumberErrorIsSupported2()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'value unknown is out of range for type bigint'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'value unknown is out of range for type bigint')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER);
} }
public function testInvalidNumberErrorIsSupported3() {
public function testInvalidNumberErrorIsSupported3()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'integer out of range'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'integer out of range')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER);
} }
public function testInvalidNumberErrorIsSupported4() {
public function testInvalidNumberErrorIsSupported4()
{
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'invalid input syntax for type integer'))); $this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'invalid input syntax for type integer')));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID_NUMBER);
} }
public function testNoSuchFieldErrorIsSupported() {
public function testNoSuchFieldErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'column name (of relation xx) does not exist')); $this->exc->processErrorInfo(array(0, 0, 'column name (of relation xx) does not exist'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
} }
public function testNoSuchFieldErrorIsSupported2() {
public function testNoSuchFieldErrorIsSupported2()
{
$this->exc->processErrorInfo(array(0, 0, 'attribute xx not found')); $this->exc->processErrorInfo(array(0, 0, 'attribute xx not found'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
} }
public function testNoSuchFieldErrorIsSupported3() {
public function testNoSuchFieldErrorIsSupported3()
{
$this->exc->processErrorInfo(array(0, 0, 'relation xx does not have attribute')); $this->exc->processErrorInfo(array(0, 0, 'relation xx does not have attribute'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
} }
public function testNoSuchFieldErrorIsSupported4() {
public function testNoSuchFieldErrorIsSupported4()
{
$this->exc->processErrorInfo(array(0, 0, 'column xx specified in USING clause does not exist in left table')); $this->exc->processErrorInfo(array(0, 0, 'column xx specified in USING clause does not exist in left table'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
} }
public function testNoSuchFieldErrorIsSupported5() {
public function testNoSuchFieldErrorIsSupported5()
{
$this->exc->processErrorInfo(array(0, 0, 'column xx specified in USING clause does not exist in right table')); $this->exc->processErrorInfo(array(0, 0, 'column xx specified in USING clause does not exist in right table'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
} }
public function testNotFoundErrorIsSupported() {
public function testNotFoundErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'index xx does not exist/')); $this->exc->processErrorInfo(array(0, 0, 'index xx does not exist/'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOT_FOUND); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOT_FOUND);
} }
public function testNotNullConstraintErrorIsSupported() { public function testNotNullConstraintErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'violates not-null constraint')); $this->exc->processErrorInfo(array(0, 0, 'violates not-null constraint'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT_NOT_NULL); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT_NOT_NULL);
} }
public function testConstraintErrorIsSupported() {
public function testConstraintErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'referential integrity violation')); $this->exc->processErrorInfo(array(0, 0, 'referential integrity violation'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT);
} }
public function testConstraintErrorIsSupported2() {
public function testConstraintErrorIsSupported2()
{
$this->exc->processErrorInfo(array(0, 0, 'violates xx constraint')); $this->exc->processErrorInfo(array(0, 0, 'violates xx constraint'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT);
} }
public function testInvalidErrorIsSupported() {
public function testInvalidErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'value too long for type character')); $this->exc->processErrorInfo(array(0, 0, 'value too long for type character'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_INVALID);
} }
public function testAlreadyExistsErrorIsSupported() {
public function testAlreadyExistsErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'relation xx already exists')); $this->exc->processErrorInfo(array(0, 0, 'relation xx already exists'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_ALREADY_EXISTS); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_ALREADY_EXISTS);
} }
public function testDivZeroErrorIsSupported() {
public function testDivZeroErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'division by zero')); $this->exc->processErrorInfo(array(0, 0, 'division by zero'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_DIVZERO); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_DIVZERO);
} }
public function testDivZeroErrorIsSupported2() {
public function testDivZeroErrorIsSupported2()
{
$this->exc->processErrorInfo(array(0, 0, 'divide by zero')); $this->exc->processErrorInfo(array(0, 0, 'divide by zero'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_DIVZERO); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_DIVZERO);
} }
public function testAccessViolationErrorIsSupported() {
public function testAccessViolationErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'permission denied')); $this->exc->processErrorInfo(array(0, 0, 'permission denied'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_ACCESS_VIOLATION); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_ACCESS_VIOLATION);
} }
public function testValueCountOnRowErrorIsSupported() {
public function testValueCountOnRowErrorIsSupported()
{
$this->exc->processErrorInfo(array(0, 0, 'more expressions than target columns')); $this->exc->processErrorInfo(array(0, 0, 'more expressions than target columns'));
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_VALUE_COUNT_ON_ROW); $this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_VALUE_COUNT_ON_ROW);
......
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