My PHPUnit test is throwing an error saying that my file_managed
test database table does not exist. What module do I need to include for that test table to get created? I would think it should be the file
module, but I've already got that listed in my $modules array.
This is a Kernel test and I've been trying to fill up the modules array with everything I can think of that might actually get that table created.
public static $modules = [
'system',
'path',
'user',
'file',
'file_test',
'node',
'field',
'media_entity',
'entity',
'image',
'graphql',
'graphql_core',
'custom_graphql_file_upload',
'custom_graphql_field'
];
Here's the error:
Invalid GraphQL query. Errors: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'contenta.test87607590file_managed' doesn't exist: INSERT INTO {file_managed} (uuid, langcode, uid, filename, uri, filemime, filesize, status, created, changed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array
I'm trying to test a graphql
file upload to make sure the file entity gets created as expected. I have a lot more tests I want to write and lot more that needs to be solved with multi-part/form data, etc, but I need to figure this out first I think.
Here's the full test https://github.com/justinlevi/graphql_custom_file_upload/blob/feature/PHPUnitTest_WIP/tests/src/Kernel/MutationFileUploadTest.php
All other code posted as well on the WIP branch.