diff --git a/tests/Export/FirebirdTestCase.php b/tests/Export/FirebirdTestCase.php index ab8e34710..0374767af 100644 --- a/tests/Export/FirebirdTestCase.php +++ b/tests/Export/FirebirdTestCase.php @@ -1,6 +1,39 @@ . + */ + +/** + * Doctrine_Export_Firebird_TestCase + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase +{ + public function testCreateDatabaseDoesNotExecuteSql() + { try { $this->export->createDatabase('db'); $this->fail(); @@ -8,7 +41,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase { $this->pass(); } } - public function testDropDatabaseDoesNotExecuteSql() { + public function testDropDatabaseDoesNotExecuteSql() + { try { $this->export->dropDatabase('db'); $this->fail(); @@ -16,7 +50,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase { $this->pass(); } } - public function testCreateTableSupportsAutoincPks() { + public function testCreateTableSupportsAutoincPks() + { $name = 'mytable'; $fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'autoincrement' => true)); @@ -31,7 +66,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase { NEW.id = GEN_ID(mytable_seq, 1); END'); } - public function testCreateTableSupportsDefaultAttribute() { + public function testCreateTableSupportsDefaultAttribute() + { $name = 'mytable'; $fields = array('name' => array('type' => 'char', 'length' => 10, 'default' => 'def'), 'type' => array('type' => 'integer', 'length' => 3, 'default' => 12) @@ -42,7 +78,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (name CHAR(10) DEFAULT \'def\', type INT DEFAULT 12, PRIMARY KEY(name, type))'); } - public function testCreateTableSupportsMultiplePks() { + public function testCreateTableSupportsMultiplePks() + { $name = 'mytable'; $fields = array('name' => array('type' => 'char', 'length' => 10), 'type' => array('type' => 'integer', 'length' => 3)); diff --git a/tests/Export/OracleTestCase.php b/tests/Export/OracleTestCase.php index f395efcca..8c1f081d4 100644 --- a/tests/Export/OracleTestCase.php +++ b/tests/Export/OracleTestCase.php @@ -1,4 +1,35 @@ . + */ + +/** + * Doctrine_Export_Oracle_TestCase + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ class Doctrine_Export_Oracle_TestCase extends Doctrine_UnitTestCase { public function testCreateSequenceExecutesSql() { $sequenceName = 'sequence'; diff --git a/tests/Query/FromTestCase.php b/tests/Query/FromTestCase.php index b7ab71995..906e53aa8 100644 --- a/tests/Query/FromTestCase.php +++ b/tests/Query/FromTestCase.php @@ -1,6 +1,39 @@ . + */ + +/** + * Doctrine_Export_Oracle_TestCase + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase +{ + public function testLeftJoin() + { $q = new Doctrine_Query(); $q->from('User u LEFT JOIN u.Group'); @@ -10,7 +43,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 8); } - public function testDefaultJoinIsLeftJoin() { + public function testDefaultJoinIsLeftJoin() + { $q = new Doctrine_Query(); $q->from('User u JOIN u.Group'); @@ -20,7 +54,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 8); } - public function testInnerJoin() { + public function testInnerJoin() + { $q = new Doctrine_Query(); $q->from('User u INNER JOIN u.Group'); @@ -30,7 +65,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 1); } - public function testMultipleLeftJoin() { + public function testMultipleLeftJoin() + { $q = new Doctrine_Query(); $q->from('User u LEFT JOIN u.Group LEFT JOIN u.Phonenumber'); @@ -40,7 +76,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 8); } - public function testMultipleLeftJoin2() { + public function testMultipleLeftJoin2() + { $q = new Doctrine_Query(); $q->from('User u LEFT JOIN u.Group LEFT JOIN u.Phonenumber'); @@ -50,7 +87,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 8); } - public function testMultipleInnerJoin() { + public function testMultipleInnerJoin() + { $q = new Doctrine_Query(); $q->select('u.name')->from('User u INNER JOIN u.Group INNER JOIN u.Phonenumber'); @@ -60,7 +98,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 1); } - public function testMultipleInnerJoin2() { + public function testMultipleInnerJoin2() + { $q = new Doctrine_Query(); $q->select('u.name')->from('User u INNER JOIN u.Group, u.Phonenumber'); @@ -70,7 +109,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 1); } - public function testMixingOfJoins() { + public function testMixingOfJoins() + { $q = new Doctrine_Query(); $q->select('u.name, g.name, p.phonenumber')->from('User u INNER JOIN u.Group g LEFT JOIN u.Phonenumber p'); diff --git a/tests/Query/SubqueryTestCase.php b/tests/Query/SubqueryTestCase.php index 2d1771c70..7f48c2510 100644 --- a/tests/Query/SubqueryTestCase.php +++ b/tests/Query/SubqueryTestCase.php @@ -1,6 +1,40 @@ . + */ + +/** + * Doctrine_Query_Subquery_TestCase + * This test case is used for testing DQL subquery functionality + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Query_Subquery_TestCase extends Doctrine_UnitTestCase +{ + public function testSubqueryWithWherePartAndInExpression() + { $q = new Doctrine_Query(); $q->from('User')->where("User.id NOT IN (FROM User(id) WHERE User.name = 'zYne')"); @@ -12,5 +46,9 @@ class Doctrine_Query_Subquery_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($users->count(), 7); $this->assertEqual($users[0]->name, 'Arnold Schwarzenegger'); } + public function testSubqueryAllowsSelectingOfAnyField() + { + + } } ?>