1
0
mirror of synced 2025-02-02 21:41:45 +03:00

3614 Commits

Author SHA1 Message Date
Luís Cobucci
74c8a08828
Use short-array syntax on "tests" directory 2016-12-07 23:33:41 +01:00
Marco Pivetta
dc3b166811 #6017 replaced random_int() with rand(), since we still support oldstable PHP (5.6.x) 2016-11-27 18:38:57 +01:00
Marco Pivetta
44a6141235 #6017 removed clear($entityName) tests from UnitOfWorkTest: now covered in EntityManagerTest 2016-11-27 18:37:45 +01:00
Marco Pivetta
92274124f9 #6017 moving tests around clear() into the EntityManager tests
`UnitOfWork` assumptions are OK, since we don't want to clutter the API even more down there
2016-11-27 18:37:45 +01:00
Marco Pivetta
49333867f8 FQCN reference correction 2016-11-27 18:36:49 +01:00
Marco Pivetta
9894dcb4b0 #6017 clear($proxyClassName) should behave like clear($realClassName) 2016-11-27 18:36:49 +01:00
Marco Pivetta
fdb2af07e7 #6017 hardened clear() logic, which now ensures that persisted entries are correctly cleared 2016-11-27 18:36:49 +01:00
Marco Pivetta
c1038096e0 #6017 requesting clear('nonExistingEntityName') should raise a MappingException 2016-11-27 18:36:48 +01:00
Marco Pivetta
c97799f151 #6017 expecting an ORMInvalidArgumentException when clearing with invalid data 2016-11-27 18:36:48 +01:00
Marco Pivetta
56598596a4 #6017 adding @group annotation to newly introduced tests 2016-11-27 18:36:48 +01:00
Marco Pivetta
6ad9c9ea04 #6017 test coverage for ORMInvalidArgumentException::invalidEntityName 2016-11-27 18:36:48 +01:00
Jeremy Benoist
6b1d64d484 Remove unecessary persist in tests 2016-11-27 18:36:48 +01:00
Jeremy Benoist
be4aafd4f6 Use ORMException instead of a default exception 2016-11-27 18:36:48 +01:00
Jeremy Benoist
2a7d21ad18 Throw an exception instead of a workaround 2016-11-27 18:36:48 +01:00
Jeremy Benoist
4a87f00fab Avoid error when entityName isn't a string 2016-11-27 18:36:48 +01:00
Marco Pivetta
cff5c07014 #5935 #5684 #6020 #6152 removed useless NAME constant from the test 2016-11-27 17:49:09 +01:00
Marco Pivetta
73ea0ba8f3 #5935 #5684 #6020 #6152 adding description to the test scenario 2016-11-27 17:45:50 +01:00
Christian Hammerl
0a86c324ad
Add test case for autoincremented id of custom type 2016-11-27 01:45:56 +01:00
Marco Pivetta
f8002ca27e #6068 hardened test logic to verify that nothing is present after the |null in @var and @return types 2016-11-26 06:35:23 +01:00
Javier Spagnoletti
ad6469b64a Update tests 2016-11-26 06:12:31 +01:00
Marco Pivetta
9acf170292 #6110 split test into multiple sub-scenarios involving PersistentCollection key checking 2016-11-26 06:02:16 +01:00
Steevan BARBOYON
fa09a95023 Clear $this->collection even when empty, to reset indexes 2016-11-26 05:57:56 +01:00
Marco Pivetta
a9c2778f30 Merge pull request #6085 from arjank/fix/Call_correct_method_in_test
More specific named native query throw exceptions test
2016-11-26 05:28:28 +01:00
Marco Pivetta
3cd7b8c951 #5987 CS: spacing after ! (not) operator 2016-11-26 05:23:04 +01:00
Javier Spagnoletti
e2b198112e [minor] Add missing type hints, add strictness for some checks, remove some useless calls 2016-11-26 05:18:46 +01:00
Marco Pivetta
899393d3bb Merge pull request #6142 from mbeccati/php72-count-fix
Fix incompatibility w/ PHP7.2+
2016-11-26 04:56:39 +01:00
Luís Cobucci
6344fd34cb
Improving the documentation of enums as discriminators test
@Ocramius was too eager to merge stuff

Related to: https://github.com/doctrine/doctrine2/pull/6141
2016-11-23 19:20:47 +01:00
Luís Cobucci
1b39cd87ad
Allow using objects as discriminators 2016-11-23 18:56:36 +01:00
Matteo Beccati
39dcf3e4c6 Fix incompatibility w/ PHP7.2+
Mock_ParserResult_*::getParameterMappings() was returning null, which
was then passed to count() on Query.php:308, causing a "Parameter must
be an array or an object that implements Countable" error.
2016-11-22 07:42:06 +01:00
Luís Cobucci
317e86802d
Make child entity share the timestamp region with parent class 2016-11-20 19:27:53 +00:00
Marco Pivetta
e7856f90d8 Merge branch 'feature/#6136-better-exception-message-on-invalid-connection-object'
Close #6136
2016-11-18 09:21:18 +01:00
Marco Pivetta
d2643eeb8b #6136 Removed regex assertion - constant assertion is sufficient 2016-11-18 09:19:27 +01:00
SpacePossum
e37041aa94 Update message. 2016-11-18 08:06:11 +01:00
Alexander Guz
8d433cdb39 #6129 Fixed code style and @depends in test. 2016-11-17 21:05:58 +01:00
SpacePossum
f9a605f6ca Add details about invalid Connection passed at creation. 2016-11-17 17:23:22 +01:00
Alexander Guz
7bf206adb4 #6129 Moved test to AbstractMappingDriverTest. 2016-11-16 20:01:11 +01:00
Alexander Guz
8580f02c6a #6129 Use User::class to get metadata instead of string. 2016-11-16 18:07:58 +01:00
Alexander Guz
cdf4af5f27 Added unit test for boolean option values.
It fail now. In `XmlDriver::_parseOptions` we need somehow to maintain
a list of options, that are supposed to be boolean, and then call
`$this->evaluateBoolean()` on them.
2016-11-16 17:56:07 +01:00
Jefersson Nathan
dbe843fc4b
remove license from header of test files 2016-10-26 13:24:33 -03:00
Arjan
a4379cc9e2 Fixes named native query test
- Makes sure the correct method is called in the test
- Verifies that the correct method is called by checking the exception message
2016-10-13 22:54:32 +02:00
Marco Pivetta
3fca33bdc4 #5768 #5755 cleaned up test scenario, using new mocking logic as per PHPUnit 5.4+ 2016-09-10 20:45:01 +02:00
Ed Hartwell Goose
67e205b36a Fixes #5755, uses '->getReflectionProperties()' instead of '->getReflectionClass()->getProperties()' to ensure all fields are copied, and adds test to confirm behaviour 2016-09-10 20:37:20 +02:00
Marco Pivetta
503b211a22 #5689 removed unused reflection access 2016-09-10 20:19:15 +02:00
Marco Pivetta
f8436b2165 #5689 removed OidReuseTest, which was moved to UnitOfWork tests 2016-09-10 20:15:59 +02:00
Marco Pivetta
75bf197e11 #5689 moved OidReuseTest contents into the UnitOfWork tests 2016-09-10 20:15:33 +02:00
Mathieu De Zutter
44af69c5d2 Additional assertion to check that unreferenced objects are not in UOW. 2016-09-09 23:22:31 +02:00
Mathieu De Zutter
01d51bfca3 Avoid conflicts due to spl_object_hash().
When merging an entity with a to-many association, it will store the
original entity data using the object hash of the to-be-merged entity
instead of the managed entity. Since this to-be-merged entity is not
managed by Doctrine, it can disappear from the memory. A new object
can reuse the same memory location and thus have the same object hash.
When one tries to persist this object as new, Doctrine will refuse it
because it thinks that the entity is managed+dirty.

This patch is a very naive fix: it just disables storing the original
entity data in case of to-many associations. It may not be the ideal
or even a good solution at all, but it solves the problem of object
hash reuse.

The test case relies on the immediate reusing of memory locations by
PHP. The variable $user has twice the same object hash, though referring
a different object. Tested on PHP 5.6.17

Without the fix, the test fails on the last line with:
A managed+dirty entity Doctrine\Tests\Models\CMS\CmsUser@[...] can not
be scheduled for insertion.
2016-09-09 23:22:31 +02:00
Luís Cobucci
b431332cef Evict query cache when entities are updated 2016-09-08 13:50:06 +02:00
Luís Cobucci
16a3a2a132 Use microtime to have more precision on cache time 2016-09-08 13:50:06 +02:00
Carl Vuorinen
43d22984ae Add unit test for SimpleObjectHydrator 2016-09-08 13:37:00 +02:00