I created a new User model in tests in order to have a real foreign key, so that I could test the usefulness of this line $this->query->whereNotNull($fullKey); in HasOneOrMany (see testARelationshipWithAForeignKeyIsEmptyOnANewInstance).
I also ended up locking down the belongsTo relationship with only null values. in order to have a consistent behaviour with the opposite hasMany (see testARelationshipWithOnlyNullValuesIsNotSupported). Not sure about that though, let me know what you think.
Please see #80.
I created a new User model in tests in order to have a real foreign key, so that I could test the usefulness of this line
$this->query->whereNotNull($fullKey);
in HasOneOrMany (see testARelationshipWithAForeignKeyIsEmptyOnANewInstance).I also ended up locking down the belongsTo relationship with only null values. in order to have a consistent behaviour with the opposite hasMany (see testARelationshipWithOnlyNullValuesIsNotSupported). Not sure about that though, let me know what you think.
Any comment or suggestion appreciated!