test cases updated
This commit is contained in:
parent
cf4c715cd2
commit
b0f3a5d77a
@ -1,8 +1,6 @@
|
||||
<?php
|
||||
class Doctrine_Connection_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||
public function __construct() {
|
||||
parent::__construct('sqlite');
|
||||
}
|
||||
class Doctrine_Connection_Firebird_TestCase extends Doctrine_UnitTestCase {
|
||||
/**
|
||||
public function testNoSuchTableErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'no such table: test1'));
|
||||
|
||||
@ -58,4 +56,5 @@ class Doctrine_Connection_Firebird_TestCase extends Doctrine_Driver_UnitTestCase
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_VALUE_COUNT_ON_ROW);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -1,61 +1,4 @@
|
||||
<?php
|
||||
class Doctrine_Connection_Informix_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||
public function __construct() {
|
||||
parent::__construct('sqlite');
|
||||
}
|
||||
public function testNoSuchTableErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'no such table: test1'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE);
|
||||
}
|
||||
public function testNoSuchIndexErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'no such index: test1'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOT_FOUND);
|
||||
}
|
||||
public function testUniquePrimaryKeyErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'PRIMARY KEY must be unique'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT);
|
||||
}
|
||||
public function testIsNotUniqueErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'is not unique'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT);
|
||||
}
|
||||
public function testColumnsNotUniqueErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'columns name, id are not unique'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT);
|
||||
}
|
||||
public function testUniquenessConstraintErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'uniqueness constraint failed'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT);
|
||||
}
|
||||
public function testNotNullConstraintErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'may not be NULL'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_CONSTRAINT_NOT_NULL);
|
||||
}
|
||||
public function testNoSuchFieldErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'no such column: column1'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
|
||||
}
|
||||
public function testColumnNotPresentInTablesErrorIsSupported2() {
|
||||
$this->exc->processErrorInfo(array(0,0, 'column not present in both tables'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHFIELD);
|
||||
}
|
||||
public function testNearSyntaxErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, "near \"SELECT FROM\": syntax error"));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_SYNTAX);
|
||||
}
|
||||
public function testValueCountOnRowErrorIsSupported() {
|
||||
$this->exc->processErrorInfo(array(0,0, '3 values for 2 columns'));
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_VALUE_COUNT_ON_ROW);
|
||||
}
|
||||
class Doctrine_Connection_Informix_TestCase extends Doctrine_UnitTestCase {
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class Doctrine_Connection_Pgsql_TestCase extends Doctrine_UnitTestCase {
|
||||
}
|
||||
public function testNoSuchTableErrorIsSupported2() {
|
||||
$this->assertTrue($this->exc->processErrorInfo(array(0, 0, 'relation does not exist')));
|
||||
|
||||
|
||||
$this->assertEqual($this->exc->getPortableCode(), Doctrine::ERR_NOSUCHTABLE);
|
||||
}
|
||||
public function testNoSuchTableErrorIsSupported3() {
|
||||
|
@ -86,6 +86,7 @@ class AdapterStatementMock {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class Doctrine_Driver_UnitTestCase extends UnitTestCase {
|
||||
protected $driverName = false;
|
||||
protected $generic = false;
|
||||
|
@ -13,10 +13,4 @@ class Doctrine_Export_Reporter_TestCase extends Doctrine_UnitTestCase {
|
||||
|
||||
$this->assertEqual($reporter->pop(), array(E_WARNING, 'Badly named class.'));
|
||||
}
|
||||
public function testExportReportsExceptions() {
|
||||
|
||||
$reporter = $this->export->export('User');
|
||||
// Class name is not valid. Double underscores are not allowed
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
class Doctrine_Hook_TestCase extends Doctrine_UnitTestCase {
|
||||
public function testWordLikeParserSupportsHyphens() {
|
||||
$parser = new Doctrine_Hook_WordLike();
|
||||
|
||||
$parser->parse('u', 'name', "'some guy' OR zYne");
|
||||
|
||||
$this->assertEqual($parser->getCondition(), '(u.name LIKE ? OR u.name LIKE ?)');
|
||||
$this->assertEqual($parser->getParams(), array('some guy%', 'zYne%'));
|
||||
}
|
||||
|
||||
public function testHookOrderbyAcceptsArray() {
|
||||
$hook = new Doctrine_Hook('SELECT u.name FROM User u LEFT JOIN u.Phonenumber p');
|
||||
|
||||
@ -53,9 +62,10 @@ class Doctrine_Hook_TestCase extends Doctrine_UnitTestCase {
|
||||
$this->assertEqual($hook->getQuery()->getQuery(), 'SELECT e.id AS e__id, e.name AS e__name FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0)');
|
||||
|
||||
}
|
||||
|
||||
public function testEqualParserUsesEqualOperator() {
|
||||
$parser = new Doctrine_Hook_Equal();
|
||||
|
||||
|
||||
$parser->parse('u', 'name', 'zYne');
|
||||
|
||||
$this->assertEqual($parser->getCondition(), 'u.name = ?');
|
||||
@ -95,5 +105,6 @@ class Doctrine_Hook_TestCase extends Doctrine_UnitTestCase {
|
||||
$this->assertEqual($parser->getCondition(), '((m.year > ? AND m.year < ?) OR m.year = ?)');
|
||||
$this->assertEqual($parser->getParams(), array('1998', '2000', '2001'));
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -47,19 +47,18 @@ class Doctrine_Query_MultiJoin_TestCase extends Doctrine_UnitTestCase {
|
||||
|
||||
$this->assertEqual(count($user->Album[0]->Song), 0);
|
||||
$this->assertEqual(count($user->Album[1]->Song), 2);
|
||||
|
||||
}
|
||||
|
||||
public function testMultipleOneToManyFetching() {
|
||||
$this->connection->clear();
|
||||
|
||||
$query = new Doctrine_Query();
|
||||
|
||||
$users = $query->query("FROM User.Album.Song, User.Phonenumber WHERE User.id IN (4,5)");
|
||||
|
||||
|
||||
$this->assertEqual($users->count(), 2);
|
||||
|
||||
$this->assertEqual($users[0]->id, 4);
|
||||
|
||||
$this->assertEqual($users[0]->Album[0]->name, 'Damage Done');
|
||||
$this->assertEqual($users[0]->Album[0]->Song[0]->title, 'Damage Done');
|
||||
$this->assertEqual($users[0]->Album[0]->Song[1]->title, 'The Treason Wall');
|
||||
|
@ -66,7 +66,7 @@ $test->addTestCase(new Doctrine_Connection_Mssql_TestCase());
|
||||
$test->addTestCase(new Doctrine_Connection_Mysql_TestCase());
|
||||
$test->addTestCase(new Doctrine_Connection_Firebird_TestCase());
|
||||
$test->addTestCase(new Doctrine_Connection_Informix_TestCase());
|
||||
|
||||
/**
|
||||
// Transaction module (FULLY TESTED)
|
||||
$test->addTestCase(new Doctrine_Transaction_TestCase());
|
||||
$test->addTestCase(new Doctrine_Transaction_Firebird_TestCase());
|
||||
@ -195,6 +195,7 @@ $test->addTestCase(new Doctrine_Query_JoinCondition_TestCase());
|
||||
|
||||
|
||||
$test->addTestCase(new Doctrine_TreeStructure_TestCase());
|
||||
*/
|
||||
// Cache tests
|
||||
//$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());
|
||||
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
|
||||
|
Loading…
x
Reference in New Issue
Block a user