Author: guilhermeblanco
Date: 2008-08-27 07:46:28 +0100 (Wed, 27 Aug 2008)
New Revision: 4847
Removed:
branches/1.0/tests/CustomResultSetOrderTestCaseTestCase.php
Modified:
branches/1.0/lib/Doctrine.php
branches/1.0/lib/Doctrine/Query/Abstract.php
branches/1.0/tests/CustomResultSetOrderTestCase.php
branches/1.0/tests/Data/ImportTestCase.php
branches/1.0/tests/DataType/EnumTestCase.php
branches/1.0/tests/Hydrate/FetchModeTestCase.php
branches/1.0/tests/Query/ComponentAliasTestCase.php
branches/1.0/tests/Query/JoinTestCase.php
branches/1.0/tests/Query/MultiJoin2TestCase.php
branches/1.0/tests/Query/MultipleAggregateValueTestCase.php
branches/1.0/tests/Query/OneToOneFetchingTestCase.php
branches/1.0/tests/Query/SelectTestCase.php
branches/1.0/tests/Record/ZeroValuesTestCase.php
branches/1.0/tests/TableTestCase.php
branches/1.0/tests/Ticket/1015TestCase.php
branches/1.0/tests/Ticket/1205TestCase.php
branches/1.0/tests/Ticket/576TestCase.php
branches/1.0/tests/Ticket/626CTestCase.php
Log:
Dropped Doctrine_Record related FETCH_* constants, as scheduled for removal.
Modified: branches/1.0/lib/Doctrine/Query/Abstract.php
===================================================================
--- branches/1.0/lib/Doctrine/Query/Abstract.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/lib/Doctrine/Query/Abstract.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -222,7 +222,7 @@
* @var array $_options an array of options
*/
protected $_options = array(
- 'fetchMode' => Doctrine::FETCH_RECORD
+ 'hydrationMode' => Doctrine::HYDRATE_RECORD
);
/**
Modified: branches/1.0/lib/Doctrine.php
===================================================================
--- branches/1.0/lib/Doctrine.php 2008-08-27 06:20:38 UTC (rev 4846)
+++ branches/1.0/lib/Doctrine.php 2008-08-27 06:46:28 UTC (rev 4847)
@@ -216,56 +216,8 @@
* FETCHMODE CONSTANTS
*/
- /**
- * IMMEDIATE FETCHING
- * mode for immediate fetching
- */
- const FETCH_IMMEDIATE = 0;
/**
- * BATCH FETCHING
- * mode for batch fetching
- */
- const FETCH_BATCH = 1;
-
- /**
- * LAZY FETCHING
- * mode for offset fetching
- */
- const FETCH_OFFSET = 3;
-
- /**
- * LAZY OFFSET FETCHING
- * mode for lazy offset fetching
- */
- const FETCH_LAZY_OFFSET = 4;
-
- /**
- * FETCH CONSTANTS
- */
-
-
- /**
- * FETCH VALUEHOLDER
- */
- const FETCH_VHOLDER = 1;
-
- /**
- * FETCH RECORD
- *
- * Specifies that the fetch method shall return Doctrine_Record
- * objects as the elements of the result set.
- *
- * This is the default fetchmode.
- */
- const FETCH_RECORD = 2;
-
- /**
- * FETCH ARRAY
- */
- const FETCH_ARRAY = 3;
-
- /**
* PORTABILITY CONSTANTS
*/
Modified: branches/1.0/tests/CustomResultSetOrderTestCase.php
===================================================================
--- branches/1.0/tests/CustomResultSetOrderTestCase.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/tests/CustomResultSetOrderTestCase.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -105,7 +105,7 @@
->from('CategoryWithPosition c')
->leftJoin('c.Boards b')
->orderBy('c.position ASC, b.position ASC')
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual(3, count($categories), 'Some categories were
doubled!');
Deleted: branches/1.0/tests/CustomResultSetOrderTestCaseTestCase.php
===================================================================
--- branches/1.0/tests/CustomResultSetOrderTestCaseTestCase.php 2008-08-27
06:20:38 UTC (rev 4846)
+++ branches/1.0/tests/CustomResultSetOrderTestCaseTestCase.php 2008-08-27
06:46:28 UTC (rev 4847)
@@ -1,34 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.phpdoctrine.org>.
- */
-
-/**
- * Doctrine_CustomResultSetOrderTestCase
- *
- * @package Doctrine
- * @author Konsta Vesterinen <[EMAIL PROTECTED]>
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @category Object Relational Mapping
- * @link www.phpdoctrine.org
- * @since 1.0
- * @version $Revision$
- */
-class Doctrine_CustomResultSetOrderTestCase extends Doctrine_UnitTestCase {
-}
Modified: branches/1.0/tests/Data/ImportTestCase.php
===================================================================
--- branches/1.0/tests/Data/ImportTestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Data/ImportTestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -228,7 +228,7 @@
$query = new Doctrine_Query();
$query->from('ImportNestedSet');
- $i = $query->execute(array(), Doctrine::FETCH_ARRAY);
+ $i = $query->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual($i[0]['name'], 'Root');
$this->assertEqual($i[0]['lft'], 1);
@@ -302,7 +302,7 @@
->from('ImportNestedSetMultipleTree insmt')
->orderBy('insmt.root_id ASC, insmt.lft ASC');
- $i = $query->execute(array(), Doctrine::FETCH_ARRAY);
+ $i = $query->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual($i[0]['name'], 'Item 1');
$this->assertEqual($i[0]['lft'], 1);
Modified: branches/1.0/tests/DataType/EnumTestCase.php
===================================================================
--- branches/1.0/tests/DataType/EnumTestCase.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/tests/DataType/EnumTestCase.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -1,258 +1,258 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.phpdoctrine.org>.
- */
-
-/**
- * Doctrine_DataType_Enum_TestCase
- *
- * @package Doctrine
- * @author Konsta Vesterinen <[EMAIL PROTECTED]>
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @category Object Relational Mapping
- * @link www.phpdoctrine.org
- * @since 1.0
- * @version $Revision$
- */
-class Doctrine_DataType_Enum_TestCase extends Doctrine_UnitTestCase
-{
- public function prepareData()
- { }
- public function prepareTables()
- {
- $this->tables = array("EnumTest", "EnumTest2", "EnumTest3");
- parent::prepareTables();
- }
-
- public function testParameterConversion()
- {
- $test = new EnumTest();
- $test->status = 'open';
- $this->assertEqual($test->status, 'open');
- $test->save();
-
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->query("FROM EnumTest WHERE EnumTest.status =
'open'");
- $this->assertEqual(count($ret), 1);
- } catch (Exception $e) {
- $this->fail();
- }
- }
-
- public function testUpdate()
- {
- $test = new EnumTest2();
- $test->status = 'open';
- $this->assertEqual($test->status, 'open');
- $test->save();
-
- $test_update = Doctrine::getTable('EnumTest2')->find(1);
- $test_update->status = 'verified';
- $this->assertEqual($test_update->status, 'verified');
- $test_update->save();
- }
-
- public function testDqlUpdate()
- {
- $query = new Doctrine_Query($this->connection);
- $query->update('EnumTest2 u')
- ->set('u.status', '?', 'verified');
-
- $this->assertEqual($query->getSql(), 'UPDATE enum_test2 SET status =
?');
-
- $query->execute();
-
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->query("FROM EnumTest2 WHERE EnumTest2.status =
'verified'");
- $this->assertEqual(count($ret), 1);
- } catch (Exception $e) {
- $this->fail();
- }
- }
-
- public function testParameterConversionInCount()
- {
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->parseQuery("FROM EnumTest WHERE EnumTest.status =
'open'")
- ->count();
- $this->assertEqual($ret, 1);
- } catch (Exception $e) {
- $this->fail();
- }
-
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->parseQuery("FROM EnumTest WHERE EnumTest.status =
?")
- ->count(array('open'));
- $this->assertEqual($ret, 1);
- } catch (Exception $e) {
- $this->fail($e->getMessage());
- }
- }
-
- public function testInAndNotIn()
- {
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->query("FROM EnumTest WHERE EnumTest.status IN
('open')");
- $this->assertEqual(count($ret), 1);
- } catch (Exception $e) {
- $this->fail();
- }
-
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->query("FROM EnumTest WHERE EnumTest.status NOT IN
('verified', 'closed')");
- $this->assertEqual(count($ret), 1);
- } catch (Exception $e) {
- $this->fail();
- }
- }
-
- public function testExpressionComposition()
- {
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->query("FROM EnumTest e WHERE e.id > 0 AND (e.status
!= 'closed' OR e.status = 'verified')");
- $this->assertEqual(count($ret), 1);
- } catch (Exception $e) {
- $this->fail();
- }
- }
-
- public function testNotEqual()
- {
- try {
- $query = new Doctrine_Query($this->connection);
- $ret = $query->query("FROM EnumTest WHERE EnumTest.status !=
'closed'");
- $this->assertEqual(count($ret), 1);
- } catch (Exception $e) {
- $this->fail();
- }
- }
-
- public function testEnumType()
- {
-
- $enum = new EnumTest();
- $enum->status = 'open';
- $this->assertEqual($enum->status, 'open');
- $enum->save();
- $this->assertEqual($enum->status, 'open');
- $enum->refresh();
- $this->assertEqual($enum->status, 'open');
-
- $enum->status = 'closed';
-
- $this->assertEqual($enum->status, 'closed');
-
- $enum->save();
- $this->assertEqual($enum->status, 'closed');
- $this->assertTrue(is_numeric($enum->id));
- $enum->refresh();
- $this->assertEqual($enum->status, 'closed');
- }
-
- public function testEnumTypeWithCaseConversion()
- {
- $this->conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
-
- $enum = new EnumTest();
-
- $enum->status = 'open';
- $this->assertEqual($enum->status, 'open');
-
- $enum->save();
- $this->assertEqual($enum->status, 'open');
-
- $enum->refresh();
- $this->assertEqual($enum->status, 'open');
-
- $enum->status = 'closed';
-
- $this->assertEqual($enum->status, 'closed');
-
- $enum->save();
- $this->assertEqual($enum->status, 'closed');
-
- $enum->refresh();
- $this->assertEqual($enum->status, 'closed');
-
- $this->conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
- }
-
- public function testFailingRefresh()
- {
- $enum = $this->connection->getTable('EnumTest')->find(1);
-
- $this->conn->exec('DELETE FROM enum_test WHERE id = 1');
-
- try {
- $enum->refresh();
-
- $this->fail();
- } catch(Doctrine_Record_Exception $e) {
- $this->pass();
- }
- }
-
- public function testEnumFetchArray()
- {
- $q = new Doctrine_Query();
- $q->select('e.*')
- ->from('EnumTest e')
- ->limit(1);
- $ret = $q->execute(array(), Doctrine::FETCH_ARRAY);
-
- if (is_numeric($ret[0]['status'])) {
- $this->fail();
- }
- }
-
- public function testLiteralEnumValueConversionSupportsJoins()
- {
- $q = new Doctrine_Query($this->connection);
- $q->addSelect('e.*')
- ->addSelect('e3.*')
- ->from('EnumTest e')
- ->leftJoin('e.Enum3 e3')
- ->where("e.status = 'verified'")
- ->execute();
-
- $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.status AS
e__status, e.text AS e__text, e2.text AS e2__text FROM enum_test e LEFT JOIN
enum_test3 e2 ON e.text = e2.text WHERE e.status = 'verified'");
- }
-
- public function testInvalidValueErrors()
- {
- $orig =
Doctrine_Manager::getInstance()->getAttribute(Doctrine::ATTR_VALIDATE);
- Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE,
Doctrine::VALIDATE_ALL);
- try {
- $test = new EnumTest();
- $test->status = 'opeerertn';
- $test->save();
- $this->fail();
- } catch (Exception $e) {
- $this->pass();
- }
- Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE,
$orig);
- }
+<?php
+/*
+ * $Id$
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.phpdoctrine.org>.
+ */
+
+/**
+ * Doctrine_DataType_Enum_TestCase
+ *
+ * @package Doctrine
+ * @author Konsta Vesterinen <[EMAIL PROTECTED]>
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @category Object Relational Mapping
+ * @link www.phpdoctrine.org
+ * @since 1.0
+ * @version $Revision$
+ */
+class Doctrine_DataType_Enum_TestCase extends Doctrine_UnitTestCase
+{
+ public function prepareData()
+ { }
+ public function prepareTables()
+ {
+ $this->tables = array("EnumTest", "EnumTest2", "EnumTest3");
+ parent::prepareTables();
+ }
+
+ public function testParameterConversion()
+ {
+ $test = new EnumTest();
+ $test->status = 'open';
+ $this->assertEqual($test->status, 'open');
+ $test->save();
+
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->query("FROM EnumTest WHERE EnumTest.status =
'open'");
+ $this->assertEqual(count($ret), 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+ }
+
+ public function testUpdate()
+ {
+ $test = new EnumTest2();
+ $test->status = 'open';
+ $this->assertEqual($test->status, 'open');
+ $test->save();
+
+ $test_update = Doctrine::getTable('EnumTest2')->find(1);
+ $test_update->status = 'verified';
+ $this->assertEqual($test_update->status, 'verified');
+ $test_update->save();
+ }
+
+ public function testDqlUpdate()
+ {
+ $query = new Doctrine_Query($this->connection);
+ $query->update('EnumTest2 u')
+ ->set('u.status', '?', 'verified');
+
+ $this->assertEqual($query->getSql(), 'UPDATE enum_test2 SET status =
?');
+
+ $query->execute();
+
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->query("FROM EnumTest2 WHERE EnumTest2.status =
'verified'");
+ $this->assertEqual(count($ret), 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+ }
+
+ public function testParameterConversionInCount()
+ {
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->parseQuery("FROM EnumTest WHERE EnumTest.status =
'open'")
+ ->count();
+ $this->assertEqual($ret, 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->parseQuery("FROM EnumTest WHERE EnumTest.status =
?")
+ ->count(array('open'));
+ $this->assertEqual($ret, 1);
+ } catch (Exception $e) {
+ $this->fail($e->getMessage());
+ }
+ }
+
+ public function testInAndNotIn()
+ {
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->query("FROM EnumTest WHERE EnumTest.status IN
('open')");
+ $this->assertEqual(count($ret), 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->query("FROM EnumTest WHERE EnumTest.status NOT IN
('verified', 'closed')");
+ $this->assertEqual(count($ret), 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+ }
+
+ public function testExpressionComposition()
+ {
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->query("FROM EnumTest e WHERE e.id > 0 AND (e.status
!= 'closed' OR e.status = 'verified')");
+ $this->assertEqual(count($ret), 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+ }
+
+ public function testNotEqual()
+ {
+ try {
+ $query = new Doctrine_Query($this->connection);
+ $ret = $query->query("FROM EnumTest WHERE EnumTest.status !=
'closed'");
+ $this->assertEqual(count($ret), 1);
+ } catch (Exception $e) {
+ $this->fail();
+ }
+ }
+
+ public function testEnumType()
+ {
+
+ $enum = new EnumTest();
+ $enum->status = 'open';
+ $this->assertEqual($enum->status, 'open');
+ $enum->save();
+ $this->assertEqual($enum->status, 'open');
+ $enum->refresh();
+ $this->assertEqual($enum->status, 'open');
+
+ $enum->status = 'closed';
+
+ $this->assertEqual($enum->status, 'closed');
+
+ $enum->save();
+ $this->assertEqual($enum->status, 'closed');
+ $this->assertTrue(is_numeric($enum->id));
+ $enum->refresh();
+ $this->assertEqual($enum->status, 'closed');
+ }
+
+ public function testEnumTypeWithCaseConversion()
+ {
+ $this->conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
+
+ $enum = new EnumTest();
+
+ $enum->status = 'open';
+ $this->assertEqual($enum->status, 'open');
+
+ $enum->save();
+ $this->assertEqual($enum->status, 'open');
+
+ $enum->refresh();
+ $this->assertEqual($enum->status, 'open');
+
+ $enum->status = 'closed';
+
+ $this->assertEqual($enum->status, 'closed');
+
+ $enum->save();
+ $this->assertEqual($enum->status, 'closed');
+
+ $enum->refresh();
+ $this->assertEqual($enum->status, 'closed');
+
+ $this->conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
+ }
+
+ public function testFailingRefresh()
+ {
+ $enum = $this->connection->getTable('EnumTest')->find(1);
+
+ $this->conn->exec('DELETE FROM enum_test WHERE id = 1');
+
+ try {
+ $enum->refresh();
+
+ $this->fail();
+ } catch(Doctrine_Record_Exception $e) {
+ $this->pass();
+ }
+ }
+
+ public function testEnumFetchArray()
+ {
+ $q = new Doctrine_Query();
+ $q->select('e.*')
+ ->from('EnumTest e')
+ ->limit(1);
+ $ret = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
+
+ if (is_numeric($ret[0]['status'])) {
+ $this->fail();
+ }
+ }
+
+ public function testLiteralEnumValueConversionSupportsJoins()
+ {
+ $q = new Doctrine_Query($this->connection);
+ $q->addSelect('e.*')
+ ->addSelect('e3.*')
+ ->from('EnumTest e')
+ ->leftJoin('e.Enum3 e3')
+ ->where("e.status = 'verified'")
+ ->execute();
+
+ $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.status AS
e__status, e.text AS e__text, e2.text AS e2__text FROM enum_test e LEFT JOIN
enum_test3 e2 ON e.text = e2.text WHERE e.status = 'verified'");
+ }
+
+ public function testInvalidValueErrors()
+ {
+ $orig =
Doctrine_Manager::getInstance()->getAttribute(Doctrine::ATTR_VALIDATE);
+ Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE,
Doctrine::VALIDATE_ALL);
+ try {
+ $test = new EnumTest();
+ $test->status = 'opeerertn';
+ $test->save();
+ $this->fail();
+ } catch (Exception $e) {
+ $this->pass();
+ }
+ Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE,
$orig);
+ }
}
\ No newline at end of file
Modified: branches/1.0/tests/Hydrate/FetchModeTestCase.php
===================================================================
--- branches/1.0/tests/Hydrate/FetchModeTestCase.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/tests/Hydrate/FetchModeTestCase.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -39,7 +39,7 @@
$q->select('u.*, p.*')->from('User u')->innerJoin('u.Phonenumber
p')->where("u.name = 'zYne'");;
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertTrue(is_array($users));
@@ -51,7 +51,7 @@
$q->select('u.*, p.*')->from('User u')->innerJoin('u.Phonenumber p');
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertTrue(is_array($users));
@@ -63,7 +63,7 @@
$q->select('u.*, p.*')->from('User u')->innerJoin('u.Phonenumber
p')->where("u.name = 'Jean Reno'");
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertTrue(is_array($users));
@@ -76,7 +76,7 @@
$q->select('u.*, e.*')->from('User u')->innerJoin('u.Email e');
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual(count($users), 8);
$this->assertEqual($users[0]['Email']['address'], '[EMAIL PROTECTED]');
@@ -87,7 +87,7 @@
$q->select('u.*, e.*')->from('User u')->innerJoin('u.Email
e')->where("u.name = 'zYne'");
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual(count($users), 1);
$this->assertEqual($users[0]['Email']['address'], '[EMAIL PROTECTED]');
@@ -99,7 +99,7 @@
$q->select('u.*, e.*')->from('User u')->innerJoin('u.Email e');
$count = count($this->conn);
- $users = $q->execute(array(), Doctrine::FETCH_RECORD);
+ $users = $q->execute(array(), Doctrine::HYDRATE_RECORD);
$this->assertEqual(count($users), 8);
@@ -121,7 +121,7 @@
$q->select('u.*, p.*')->from('User u')->innerJoin('u.Phonenumber p');
$count = count($this->conn);
- $users = $q->execute(array(), Doctrine::FETCH_RECORD);
+ $users = $q->execute(array(), Doctrine::HYDRATE_RECORD);
$this->assertEqual(count($users), 8);
$this->assertTrue($users[0] instanceof User);
@@ -138,7 +138,7 @@
$q->select('u.*')->from('User u');
$count = $this->conn->count();
- $users = $q->execute(array(), Doctrine::FETCH_RECORD);
+ $users = $q->execute(array(), Doctrine::HYDRATE_RECORD);
$this->assertEqual(count($users), 8);
$this->assertTrue($users[0] instanceof User);
Modified: branches/1.0/tests/Query/ComponentAliasTestCase.php
===================================================================
--- branches/1.0/tests/Query/ComponentAliasTestCase.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/tests/Query/ComponentAliasTestCase.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -75,7 +75,7 @@
$q->from('User u, u.Group g, g.Phonenumber');
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$count = count($this->conn);
@@ -112,7 +112,7 @@
$q = new Doctrine_Query();
$q->from('User u, u.Phonenumber, u.Group g,
g.Phonenumber')->where('u.id IN (5,6)');
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual(count($users), 2);
$this->assertEqual(count($users[0]['Group']), 1);
Modified: branches/1.0/tests/Query/JoinTestCase.php
===================================================================
--- branches/1.0/tests/Query/JoinTestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Query/JoinTestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -147,7 +147,7 @@
->from('Record_Country c')->leftJoin('c.City
c2')->leftJoin('c2.District d')
->where('c.id = ?', array(1));
- $countries = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $countries = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$c = $countries[0];
$this->assertEqual($c['City'][0]['name'], 'City 1');
Modified: branches/1.0/tests/Query/MultiJoin2TestCase.php
===================================================================
--- branches/1.0/tests/Query/MultiJoin2TestCase.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/tests/Query/MultiJoin2TestCase.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -106,7 +106,7 @@
->leftJoin('le.author a')
->where('c.parentCategoryId = 0')
->orderBy('c.position ASC, subCats.position ASC,
b.position ASC')
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->pass();
} catch (Doctrine_Exception $e) {
$this->fail($e->getMessage());
Modified: branches/1.0/tests/Query/MultipleAggregateValueTestCase.php
===================================================================
--- branches/1.0/tests/Query/MultipleAggregateValueTestCase.php 2008-08-27
06:20:38 UTC (rev 4846)
+++ branches/1.0/tests/Query/MultipleAggregateValueTestCase.php 2008-08-27
06:46:28 UTC (rev 4847)
@@ -80,7 +80,7 @@
$query->where("u.name = 'jon'");
$query->limit(1);
- $users = $query->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $query->execute(array(), Doctrine::HYDRATE_ARRAY);
try {
$name = $users[0]['name'];
Modified: branches/1.0/tests/Query/OneToOneFetchingTestCase.php
===================================================================
--- branches/1.0/tests/Query/OneToOneFetchingTestCase.php 2008-08-27
06:20:38 UTC (rev 4846)
+++ branches/1.0/tests/Query/OneToOneFetchingTestCase.php 2008-08-27
06:46:28 UTC (rev 4847)
@@ -107,7 +107,7 @@
->leftJoin("b.lastEntry le")
->leftJoin("le.author a")
->leftJoin("a.visibleRank vr")
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
// --> currently quits here with a fatal error! <--
@@ -162,7 +162,7 @@
->leftJoin("b.lastEntry le")
->leftJoin("le.author a")
->leftJoin("a.visibleRank vr")
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
// check boards/categories
Modified: branches/1.0/tests/Query/SelectTestCase.php
===================================================================
--- branches/1.0/tests/Query/SelectTestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Query/SelectTestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -141,7 +141,7 @@
$q->parseQuery('SELECT u.id, u.name, COUNT(p.id) FROM User u LEFT JOIN
u.Phonenumber p GROUP BY u.id');
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertEqual($users[0]['Phonenumber'][0]['COUNT'], 1);
Modified: branches/1.0/tests/Record/ZeroValuesTestCase.php
===================================================================
--- branches/1.0/tests/Record/ZeroValuesTestCase.php 2008-08-27 06:20:38 UTC
(rev 4846)
+++ branches/1.0/tests/Record/ZeroValuesTestCase.php 2008-08-27 06:46:28 UTC
(rev 4847)
@@ -60,7 +60,7 @@
{
$q = new Doctrine_Query();
$q->from('ZeroValueTest');
- $users = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $users = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->assertIdentical($users[0]['is_super_admin'], false);
// check for aggregate bug
Modified: branches/1.0/tests/TableTestCase.php
===================================================================
--- branches/1.0/tests/TableTestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/TableTestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -167,7 +167,7 @@
}
try {
- $record = $this->objTable->find('4', Doctrine::FETCH_ARRAY);
+ $record = $this->objTable->find('4', Doctrine::HYDRATE_ARRAY);
$this->assertTrue(is_array($record));
$this->assertTrue( ! is_object($record));
$this->assertTrue(array_key_exists('id', $record));
@@ -205,7 +205,7 @@
$this->assertEqual($users->count(), 8);
$this->assertTrue($users instanceof Doctrine_Collection);
- $users = $this->objTable->findAll(Doctrine::FETCH_ARRAY);
+ $users = $this->objTable->findAll(Doctrine::HYDRATE_ARRAY);
$this->assertTrue( ! $users instanceof Doctrine_Collection);
$this->assertTrue(is_array($users));
$this->assertTrue( ! is_object($users));
Modified: branches/1.0/tests/Ticket/1015TestCase.php
===================================================================
--- branches/1.0/tests/Ticket/1015TestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Ticket/1015TestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -56,7 +56,7 @@
->from('T1015_Person person')
->innerJoin('person.T1015_Points points WITH person.id = 1');
- $results = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $results = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
//var_dump($results);
$person = $results[0];
@@ -73,7 +73,7 @@
->addComponent('person', 'T1015_Person person')
->addComponent('points', 'person.T1015_Points points');
- $results = $q->execute(array(), Doctrine::FETCH_ARRAY);
+ $results = $q->execute(array(), Doctrine::HYDRATE_ARRAY);
//var_dump($results);
$person = $results[0];
Modified: branches/1.0/tests/Ticket/1205TestCase.php
===================================================================
--- branches/1.0/tests/Ticket/1205TestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Ticket/1205TestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -30,7 +30,7 @@
$q = Doctrine_Query::create()
->from('Ticket1205TestAddress a')
->innerjoin('a.User u')
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->fail();
} catch (Exception $e) {
$this->pass();
Modified: branches/1.0/tests/Ticket/576TestCase.php
===================================================================
--- branches/1.0/tests/Ticket/576TestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Ticket/576TestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -43,7 +43,7 @@
$data = Doctrine_Query::create()
->select('name')
->from('Entity')
- ->fetchOne(array(), Doctrine::FETCH_ARRAY);
+ ->fetchOne(array(), Doctrine::HYDRATE_ARRAY);
$user->hydrate($data);
$this->assertEqual($user->name, 'myname');
Modified: branches/1.0/tests/Ticket/626CTestCase.php
===================================================================
--- branches/1.0/tests/Ticket/626CTestCase.php 2008-08-27 06:20:38 UTC (rev
4846)
+++ branches/1.0/tests/Ticket/626CTestCase.php 2008-08-27 06:46:28 UTC (rev
4847)
@@ -39,7 +39,7 @@
try {
$students = Doctrine_Query::create()
->from('T626C_Student1 s INDEXBY s.id')
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->pass();
} catch (Exception $e) {
$this->fail($e->__toString());
@@ -53,7 +53,7 @@
try {
$students = Doctrine_Query::create()
->from('T626C_Student2 s INDEXBY s.id')
- ->execute(array(), Doctrine::FETCH_ARRAY);
+ ->execute(array(), Doctrine::HYDRATE_ARRAY);
$this->pass();
} catch (Exception $e) {
$this->fail($e->__toString());
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---