Unit Test for Morph many to many

Posted 7 months ago by jonassiewertsen


I am looking for an elegant way for a Unit test.

my database is looking like:

- id 
- name

- id
- name
- something else

- categorie_id
- categoryable_id
- categoryable_type

The morph relations itself are working. Now im pulling some arrays from the collections to test via assertEquals, which seems like a really ugly way of doing it.


Is there something similar way like assertInstanceOf, just for many to many relations?


Please sign in or create an account to participate in this conversation.