nextras / orm

Orm with clean object design, smart relationship loading and powerful collections.
https://nextras.org/orm
MIT License
310 stars 57 forks source link

Test file.general is not consistent with types in schema #100

Closed Mikulas closed 9 years ago

Mikulas commented 9 years ago

author.born is defined as date in both engines. The test case is valid and it should probably behave like this, but it's inconsistent. Is there a reason for the field not to be defined as datetime and timestamp in mysql and pg respectively?

https://github.com/nextras/orm/blob/master/tests/cases/integration/Mapper/file.general.phpt#L73

hrach commented 9 years ago

Sorry, I don't get it fully. :crying_cat_face:

Mikulas commented 9 years ago

It's a very minor thing, it's just weird that a column that will truncate to date is tested for time precision. This test would fail if the entity was persisted and loaded (obviously not from identity map) as it would have passed

Assert::same('2000-01-01 00:00:00', $author->born->format('Y-m-d H:i:s'));

instead.

hrach commented 9 years ago

Ou yes! Such nice issue number wasted for such minor thing :D :smile_cat:

Mikulas commented 9 years ago

Yeah right sorry about that :D

hrach commented 9 years ago

This test would fail if the entity was persisted and loaded (obviously not from identity map)

actually, it does not use an identity map, there is created new model instance between persistance & assert.