Skip to content

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Nov 8, 2023

Follow #2669

Add tests for SQL model to MongoDB model morph relation in both directions.

In tests, I rename SQL tables to singular (common practice) to ensure we don't mess with collection name of similar models. It helps when debugging.

@GromNaN GromNaN force-pushed the tests-hybrid-morph branch from a007539 to 8c353c1 Compare November 8, 2023 12:12
$photo->save();
$photo = $user->photos()->save($photo);

$this->assertEquals(1, $user->photos->count());
Copy link
Member Author

@GromNaN GromNaN Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails here:

Failed asserting that 0 matches expected 1.

But this error seems to come from Laravel itself: if I replace User with SqlUser and remove the HybridRelations trait from every Sql model, it still fails. I may have an error in the model definition.

@GromNaN GromNaN closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant