- Implemented export functionality to retrieve all rows from specified category tables. - Developed import functionality with strict validation and referential integrity checks. - Added error handling for various import scenarios including invalid formats and duplicate entries. - Introduced tests for import functionality to ensure correct behavior and validation.
1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"nodes": [{"id": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_category_categoryimporttest_php", "label": "CategoryImportTest.php", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L1"}, {"id": "category_categoryimporttest_categoryimporttest", "label": "CategoryImportTest", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L19"}, {"id": "apitestcase", "label": "ApiTestCase", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "category_categoryimporttest_categoryimporttest_db", "label": ".db()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L21"}, {"id": "connection", "label": "Connection", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L21"}, {"id": "category_categoryimporttest_categoryimporttest_rowcount", "label": ".rowCount()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L26"}, {"id": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "label": ".testValidImportReplacesTheWholeTable()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L31"}, {"id": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "label": ".testInvalidFileIsRejectedAndNothingIsWritten()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L47"}, {"id": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "label": ".testSpecialtyParentMustExistWithinTheFile()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L67"}, {"id": "category_categoryimporttest_categoryimporttest_testnonadminisforbidden", "label": ".testNonAdminIsForbidden()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L81"}, {"id": "category_categoryimporttest_categoryimporttest_testunknownbundleis404", "label": ".testUnknownBundleIs404()", "file_type": "code", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L90"}], "edges": [{"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_category_categoryimporttest_php", "target": "apitestcase", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L5", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_category_categoryimporttest_php", "target": "connection", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L6", "weight": 1.0}, {"source": "users_hamed_pj_my_pj_clinic_pro_clinicpro_tests_category_categoryimporttest_php", "target": "category_categoryimporttest_categoryimporttest", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L19", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "apitestcase", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L19", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_db", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L21", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest_db", "target": "connection", "relation": "references", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L21", "weight": 1.0, "context": "return_type"}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_rowcount", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L26", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L31", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L47", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L67", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_testnonadminisforbidden", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L81", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest", "target": "category_categoryimporttest_categoryimporttest_testunknownbundleis404", "relation": "method", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L90", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest_db", "target": "connection", "relation": "references_constant", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L23", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest_rowcount", "target": "category_categoryimporttest_categoryimporttest_db", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L28", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "target": "category_categoryimporttest_categoryimporttest_rowcount", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L43", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "target": "category_categoryimporttest_categoryimporttest_db", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L44", "weight": 1.0}, {"source": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "target": "category_categoryimporttest_categoryimporttest_rowcount", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "tests/Category/CategoryImportTest.php", "source_location": "L55", "weight": 1.0}], "raw_calls": [{"caller_nid": "category_categoryimporttest_categoryimporttest_db", "callee": "get", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L23", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_db", "callee": "static", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L23", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_rowcount", "callee": "fetchOne", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L28", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "createUser", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L33", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "authJson", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L35", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L40", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "responseCode", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L40", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L41", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L43", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L44", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testvalidimportreplacesthewholetable", "callee": "fetchOne", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L44", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "createUser", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L49", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "authJson", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L52", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "authJson", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L57", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L62", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "responseCode", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L62", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "assertNotEmpty", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L63", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testinvalidfileisrejectedandnothingiswritten", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L64", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "callee": "createUser", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L69", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "callee": "authJson", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L71", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L76", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "callee": "responseCode", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L76", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "callee": "array_column", "is_member_call": false, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L77", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testspecialtyparentmustexistwithinthefile", "callee": "assertContains", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L78", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testnonadminisforbidden", "callee": "createUser", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L83", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testnonadminisforbidden", "callee": "authJson", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L84", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testnonadminisforbidden", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L87", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testnonadminisforbidden", "callee": "responseCode", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L87", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testunknownbundleis404", "callee": "createUser", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L92", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testunknownbundleis404", "callee": "authJson", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L93", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testunknownbundleis404", "callee": "assertSame", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L96", "receiver": null}, {"caller_nid": "category_categoryimporttest_categoryimporttest_testunknownbundleis404", "callee": "responseCode", "is_member_call": true, "source_file": "/Users/hamed/pj/my_pj/clinic_pro/clinicpro/tests/Category/CategoryImportTest.php", "source_location": "L96", "receiver": null}]} |