Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
0a497062
Commit
0a497062
authored
Aug 03, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Renamed some methods for a better API.
parent
00599a80
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
46 additions
and
48 deletions
+46
-48
AbstractQuery.php
lib/Doctrine/ORM/AbstractQuery.php
+4
-6
BasicFunctionalTest.php
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
+6
-6
ClassTableInheritanceTest.php
...ctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php
+4
-4
LifecycleCallbackTest.php
...s/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php
+1
-1
ManyToManyBidirectionalAssociationTest.php
...ORM/Functional/ManyToManyBidirectionalAssociationTest.php
+3
-3
ManyToManySelfReferentialAssociationTest.php
...M/Functional/ManyToManySelfReferentialAssociationTest.php
+2
-2
ManyToManyUnidirectionalAssociationTest.php
...RM/Functional/ManyToManyUnidirectionalAssociationTest.php
+2
-2
NativeQueryTest.php
tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php
+1
-1
OneToManyBidirectionalAssociationTest.php
.../ORM/Functional/OneToManyBidirectionalAssociationTest.php
+3
-3
OneToManySelfReferentialAssociationTest.php
...RM/Functional/OneToManySelfReferentialAssociationTest.php
+2
-2
OneToOneBidirectionalAssociationTest.php
...s/ORM/Functional/OneToOneBidirectionalAssociationTest.php
+3
-3
OneToOneSelfReferentialAssociationTest.php
...ORM/Functional/OneToOneSelfReferentialAssociationTest.php
+2
-2
OneToOneUnidirectionalAssociationTest.php
.../ORM/Functional/OneToOneUnidirectionalAssociationTest.php
+3
-3
QueryCacheTest.php
tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php
+2
-2
QueryTest.php
tests/Doctrine/Tests/ORM/Functional/QueryTest.php
+3
-3
ResultCacheTest.php
tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php
+2
-2
SingleTableInheritanceTest.php
...trine/Tests/ORM/Functional/SingleTableInheritanceTest.php
+3
-3
No files found.
lib/Doctrine/ORM/AbstractQuery.php
View file @
0a497062
...
...
@@ -303,14 +303,13 @@ abstract class AbstractQuery
/**
* Gets the list of results for the query.
*
* Alias for execute(array(), HYDRATE_OBJECT).
* Alias for execute(array(),
$hydrationMode =
HYDRATE_OBJECT).
*
* @return array
* @todo getResult()
*/
public
function
getResult
List
(
)
public
function
getResult
(
$hydrationMode
=
self
::
HYDRATE_OBJECT
)
{
return
$this
->
execute
(
array
(),
self
::
HYDRATE_OBJECT
);
return
$this
->
execute
(
array
(),
$hydrationMode
);
}
/**
...
...
@@ -319,9 +318,8 @@ abstract class AbstractQuery
* Alias for execute(array(), HYDRATE_ARRAY).
*
* @return array
* @todo getArrayResult()
*/
public
function
get
ResultArray
()
public
function
get
ArrayResult
()
{
return
$this
->
execute
(
array
(),
self
::
HYDRATE_ARRAY
);
}
...
...
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
View file @
0a497062
...
...
@@ -223,7 +223,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select u from Doctrine\Tests\Models\CMS\CmsUser u"
);
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$users
));
$this
->
assertEquals
(
'Guilherme'
,
$users
[
0
]
->
name
);
...
...
@@ -232,7 +232,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
//$this->assertNull($users[0]->phonenumbers);
//$this->assertNull($users[0]->articles);
$usersArray
=
$query
->
get
ResultArray
();
$usersArray
=
$query
->
get
ArrayResult
();
$this
->
assertTrue
(
is_array
(
$usersArray
));
$this
->
assertEquals
(
1
,
count
(
$usersArray
));
...
...
@@ -260,7 +260,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select u from Doctrine\Tests\Models\CMS\CmsUser u join u.phonenumbers p"
);
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
0
,
count
(
$users
));
}
...
...
@@ -276,7 +276,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select u,p from Doctrine\Tests\Models\CMS\CmsUser u left join u.phonenumbers p"
);
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$users
));
$this
->
assertEquals
(
'Guilherme'
,
$users
[
0
]
->
name
);
...
...
@@ -308,7 +308,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select u, g from Doctrine\Tests\Models\CMS\CmsUser u join u.groups g"
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$this
->
assertEquals
(
2
,
$this
->
_em
->
getUnitOfWork
()
->
size
());
$this
->
assertTrue
(
$result
[
0
]
instanceof
CmsUser
);
...
...
@@ -330,7 +330,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
_em
->
clear
();
$query
=
$this
->
_em
->
createQuery
(
"select u, g from Doctrine\Tests\Models\CMS\CmsUser u inner join u.groups g"
);
$this
->
assertEquals
(
0
,
count
(
$query
->
getResult
List
()));
$this
->
assertEquals
(
0
,
count
(
$query
->
getResult
()));
}
public
function
testBasicRefresh
()
...
...
tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php
View file @
0a497062
...
...
@@ -41,7 +41,7 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select p from Doctrine\Tests\Models\Company\CompanyPerson p order by p.id asc"
);
$entities
=
$query
->
getResult
List
();
$entities
=
$query
->
getResult
();
$this
->
assertEquals
(
2
,
count
(
$entities
));
$this
->
assertTrue
(
$entities
[
0
]
instanceof
CompanyPerson
);
...
...
@@ -56,7 +56,7 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select p from Doctrine\Tests\Models\Company\CompanyEmployee p"
);
$entities
=
$query
->
getResult
List
();
$entities
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$entities
));
$this
->
assertTrue
(
$entities
[
0
]
instanceof
CompanyEmployee
);
...
...
@@ -132,7 +132,7 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
'select p, s from Doctrine\Tests\Models\Company\CompanyPerson p join p.spouse s where p.name=\'Mary Smith\''
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$result
));
$this
->
assertTrue
(
$result
[
0
]
instanceof
CompanyPerson
);
$this
->
assertEquals
(
'Mary Smith'
,
$result
[
0
]
->
getName
());
...
...
@@ -165,7 +165,7 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
'select p, f from Doctrine\Tests\Models\Company\CompanyPerson p join p.friends f where p.name=?1'
);
$query
->
setParameter
(
1
,
'Roman'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$result
));
$this
->
assertEquals
(
1
,
count
(
$result
[
0
]
->
getFriends
()));
$this
->
assertEquals
(
'Roman'
,
$result
[
0
]
->
getName
());
...
...
tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php
View file @
0a497062
...
...
@@ -30,7 +30,7 @@ class LifecycleCallbackTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
_em
->
clear
();
$query
=
$this
->
_em
->
createQuery
(
"select e from Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity e"
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$this
->
assertTrue
(
$result
[
0
]
->
postLoadCallbackInvoked
);
$result
[
0
]
->
value
=
'hello again'
;
...
...
tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php
View file @
0a497062
...
...
@@ -89,7 +89,7 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
$metadata
->
getAssociationMapping
(
'products'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'SELECT c FROM Doctrine\Tests\Models\ECommerce\ECommerceCategory c order by c.id'
);
$categories
=
$query
->
getResult
List
();
$categories
=
$query
->
getResult
();
$this
->
assertLoadingOfInverseSide
(
$categories
);
}
...
...
@@ -102,7 +102,7 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
$metadata
->
getAssociationMapping
(
'categories'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'SELECT p FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p order by p.id'
);
$products
=
$query
->
getResult
List
();
$products
=
$query
->
getResult
();
$this
->
assertEquals
(
2
,
count
(
$products
));
$this
->
assertEquals
(
0
,
count
(
$products
[
0
]
->
getCategories
()
->
unwrap
()));
...
...
@@ -128,7 +128,7 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
protected
function
_findProducts
()
{
$query
=
$this
->
_em
->
createQuery
(
'SELECT p, c FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p LEFT JOIN p.categories c ORDER BY p.id, c.id'
);
return
$query
->
getResult
List
();
return
$query
->
getResult
();
}
public
function
assertLoadingOfOwningSide
(
$products
)
...
...
tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php
View file @
0a497062
...
...
@@ -78,7 +78,7 @@ class ManyToManySelfReferentialAssociationTest extends AbstractManyToManyAssocia
$metadata
->
getAssociationMapping
(
'related'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'SELECT p FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p'
);
$products
=
$query
->
getResult
List
();
$products
=
$query
->
getResult
();
$this
->
assertLoadingOfOwningSide
(
$products
);
}
...
...
@@ -119,6 +119,6 @@ class ManyToManySelfReferentialAssociationTest extends AbstractManyToManyAssocia
protected
function
_findProducts
()
{
$query
=
$this
->
_em
->
createQuery
(
'SELECT p, r FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p LEFT JOIN p.related r ORDER BY p.id, r.id'
);
return
$query
->
getResult
List
();
return
$query
->
getResult
();
}
}
tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php
View file @
0a497062
...
...
@@ -63,7 +63,7 @@ class ManyToManyUnidirectionalAssociationTest extends AbstractManyToManyAssociat
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'SELECT c, p FROM Doctrine\Tests\Models\ECommerce\ECommerceCart c LEFT JOIN c.products p ORDER BY c.id, p.id'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$firstCart
=
$result
[
0
];
$products
=
$firstCart
->
getProducts
();
$secondCart
=
$result
[
1
];
...
...
@@ -83,7 +83,7 @@ class ManyToManyUnidirectionalAssociationTest extends AbstractManyToManyAssociat
$metadata
->
getAssociationMapping
(
'products'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'SELECT c FROM Doctrine\Tests\Models\ECommerce\ECommerceCart c'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$firstCart
=
$result
[
0
];
$products
=
$firstCart
->
getProducts
();
$secondCart
=
$result
[
1
];
...
...
tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php
View file @
0a497062
...
...
@@ -36,7 +36,7 @@ class NativeQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createNativeQuery
(
'SELECT id, name FROM cms_users WHERE username = ?'
,
$rsm
);
$query
->
setParameter
(
1
,
'romanb'
);
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$users
));
$this
->
assertTrue
(
$users
[
0
]
instanceof
CmsUser
);
...
...
tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php
View file @
0a497062
...
...
@@ -72,7 +72,7 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
{
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'select p, f from Doctrine\Tests\Models\ECommerce\ECommerceProduct p join p.features f'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$product
=
$result
[
0
];
$features
=
$product
->
getFeatures
();
...
...
@@ -92,7 +92,7 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
$metadata
->
getAssociationMapping
(
'features'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'select p from Doctrine\Tests\Models\ECommerce\ECommerceProduct p'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$product
=
$result
[
0
];
$features
=
$product
->
getFeatures
();
...
...
@@ -112,7 +112,7 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
$metadata
->
getAssociationMapping
(
'product'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'select f from Doctrine\Tests\Models\ECommerce\ECommerceFeature f'
);
$features
=
$query
->
getResult
List
();
$features
=
$query
->
getResult
();
$product
=
$features
[
0
]
->
getProduct
();
$this
->
assertTrue
(
$product
instanceof
ECommerceProduct
);
...
...
tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php
View file @
0a497062
...
...
@@ -73,7 +73,7 @@ class OneToManySelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunctio
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'select c1, c2 from Doctrine\Tests\Models\ECommerce\ECommerceCategory c1 join c1.children c2'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$result
));
$parent
=
$result
[
0
];
$children
=
$parent
->
getChildren
();
...
...
@@ -94,7 +94,7 @@ class OneToManySelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunctio
$metadata
->
getAssociationMapping
(
'children'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'select c from Doctrine\Tests\Models\ECommerce\ECommerceCategory c order by c.id asc'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$parent
=
$result
[
0
];
$children
=
$parent
->
getChildren
();
...
...
tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php
View file @
0a497062
...
...
@@ -58,7 +58,7 @@ class OneToOneBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctional
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'select c, ca from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c join c.cart ca'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$customer
=
$result
[
0
];
$this
->
assertTrue
(
$customer
->
getCart
()
instanceof
ECommerceCart
);
...
...
@@ -72,7 +72,7 @@ class OneToOneBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctional
$metadata
->
getAssociationMapping
(
'customer'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'select c from Doctrine\Tests\Models\ECommerce\ECommerceCart c'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$cart
=
$result
[
0
];
$this
->
assertTrue
(
$cart
->
getCustomer
()
instanceof
ECommerceCustomer
);
...
...
@@ -86,7 +86,7 @@ class OneToOneBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctional
$metadata
->
getAssociationMapping
(
'mentor'
)
->
fetchMode
=
AssociationMapping
::
FETCH_EAGER
;
$query
=
$this
->
_em
->
createQuery
(
'select c from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$customer
=
$result
[
0
];
$this
->
assertNull
(
$customer
->
getMentor
());
...
...
tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php
View file @
0a497062
...
...
@@ -53,7 +53,7 @@ class OneToOneSelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunction
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'select c, m from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c left join c.mentor m order by c.id asc'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$customer
=
$result
[
0
];
$this
->
assertLoadingOfAssociation
(
$customer
);
}
...
...
@@ -67,7 +67,7 @@ class OneToOneSelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunction
$metadata
->
getAssociationMapping
(
'mentor'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'select c from Doctrine\Tests\Models\ECommerce\ECommerceCustomer c'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$customer
=
$result
[
0
];
$this
->
assertLoadingOfAssociation
(
$customer
);
}
...
...
tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php
View file @
0a497062
...
...
@@ -51,7 +51,7 @@ class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
$this
->
_createFixture
();
$query
=
$this
->
_em
->
createQuery
(
'select p, s from Doctrine\Tests\Models\ECommerce\ECommerceProduct p left join p.shipping s'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$product
=
$result
[
0
];
$this
->
assertTrue
(
$product
->
getShipping
()
instanceof
ECommerceShipping
);
...
...
@@ -65,7 +65,7 @@ class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
$metadata
->
getAssociationMapping
(
'shipping'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
$query
=
$this
->
_em
->
createQuery
(
'select p from Doctrine\Tests\Models\ECommerce\ECommerceProduct p'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$product
=
$result
[
0
];
$this
->
assertTrue
(
$product
->
getShipping
()
instanceof
ECommerceShipping
);
...
...
@@ -77,7 +77,7 @@ class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
$this
->
_em
->
getConfiguration
()
->
setAllowPartialObjects
(
true
);
$query
=
$this
->
_em
->
createQuery
(
'select p from Doctrine\Tests\Models\ECommerce\ECommerceProduct p'
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$product
=
$result
[
0
];
$this
->
assertNull
(
$product
->
getShipping
());
...
...
tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php
View file @
0a497062
...
...
@@ -36,7 +36,7 @@ class QueryCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
->
setQueryCacheDriver
(
$cache
);
$this
->
assertEquals
(
0
,
$cache
->
count
());
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
$cache
->
count
());
$this
->
assertTrue
(
$cache
->
contains
(
md5
(
'select ux from Doctrine\Tests\Models\CMS\CmsUser uxDOCTRINE_QUERY_CACHE_SALT'
)));
...
...
@@ -48,7 +48,7 @@ class QueryCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query2
=
$this
->
_em
->
createQuery
(
'select ux from Doctrine\Tests\Models\CMS\CmsUser ux'
);
$query2
->
setQueryCacheDriver
(
$cache
);
$users
=
$query2
->
getResult
List
();
$users
=
$query2
->
getResult
();
$this
->
assertEquals
(
1
,
$cache
->
count
());
$this
->
assertTrue
(
$cache
->
contains
(
md5
(
'select ux from Doctrine\Tests\Models\CMS\CmsUser uxDOCTRINE_QUERY_CACHE_SALT'
)));
...
...
tests/Doctrine/Tests/ORM/Functional/QueryTest.php
View file @
0a497062
...
...
@@ -32,7 +32,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select u, upper(u.name) from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"
);
$result
=
$query
->
getResult
List
();
$result
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$result
));
$this
->
assertTrue
(
$result
[
0
][
0
]
instanceof
CmsUser
);
...
...
@@ -41,7 +41,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
assertEquals
(
'developer'
,
$result
[
0
][
0
]
->
status
);
$this
->
assertEquals
(
'GUILHERME'
,
$result
[
0
][
1
]);
$resultArray
=
$query
->
get
ResultArray
();
$resultArray
=
$query
->
get
ArrayResult
();
$this
->
assertEquals
(
1
,
count
(
$resultArray
));
$this
->
assertTrue
(
is_array
(
$resultArray
[
0
][
0
]));
$this
->
assertEquals
(
'Guilherme'
,
$resultArray
[
0
][
0
][
'name'
]);
...
...
@@ -85,7 +85,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
_em
->
clear
();
$query
=
$this
->
_em
->
createQuery
(
"select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.articles a"
);
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$users
));
$this
->
assertTrue
(
$users
[
0
]
instanceof
CmsUser
);
$this
->
assertEquals
(
2
,
count
(
$users
[
0
]
->
articles
));
...
...
tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php
View file @
0a497062
...
...
@@ -36,7 +36,7 @@ class ResultCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
$initialQueryCount
=
$this
->
_em
->
getConnection
()
->
getQueryCount
();
$users
=
$query
->
getResult
List
();
$users
=
$query
->
getResult
();
$this
->
assertEquals
(
$initialQueryCount
+
1
,
$this
->
_em
->
getConnection
()
->
getQueryCount
());
$this
->
assertEquals
(
1
,
$cache
->
count
());
...
...
@@ -48,7 +48,7 @@ class ResultCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query2
=
$this
->
_em
->
createQuery
(
'select ux from Doctrine\Tests\Models\CMS\CmsUser ux'
);
$query2
->
setResultCache
(
$cache
);
$users
=
$query2
->
getResult
List
();
$users
=
$query2
->
getResult
();
$this
->
assertEquals
(
$initialQueryCount
+
1
,
$this
->
_em
->
getConnection
()
->
getQueryCount
());
$this
->
assertEquals
(
1
,
$cache
->
count
());
...
...
tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php
View file @
0a497062
...
...
@@ -48,7 +48,7 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select e from Doctrine\Tests\ORM\Functional\ParentEntity e order by e.data asc"
);
$entities
=
$query
->
getResult
List
();
$entities
=
$query
->
getResult
();
$this
->
assertEquals
(
2
,
count
(
$entities
));
$this
->
assertTrue
(
is_numeric
(
$entities
[
0
]
->
getId
()));
...
...
@@ -63,7 +63,7 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select e from Doctrine\Tests\ORM\Functional\ChildEntity e"
);
$entities
=
$query
->
getResult
List
();
$entities
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$entities
));
$this
->
assertTrue
(
$entities
[
0
]
instanceof
ChildEntity
);
$this
->
assertTrue
(
is_numeric
(
$entities
[
0
]
->
getId
()));
...
...
@@ -74,7 +74,7 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"select r,o from Doctrine\Tests\ORM\Functional\RelatedEntity r join r.owner o"
);
$entities
=
$query
->
getResult
List
();
$entities
=
$query
->
getResult
();
$this
->
assertEquals
(
1
,
count
(
$entities
));
$this
->
assertTrue
(
$entities
[
0
]
instanceof
RelatedEntity
);
$this
->
assertTrue
(
is_numeric
(
$entities
[
0
]
->
getId
()));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment