File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,22 @@ public function testFullBackup()
89
89
Helpers::extractTar ($ findBackup ->filepath , $ findBackup ->path . '/unit-test ' );
90
90
//
91
91
// dd($chs);
92
- // dd($findBackup->path);
92
+ $ findDatabase = Database::where ('id ' , $ chs ['databaseId ' ])->first ();
93
+
94
+ $ extractedDatabase = $ findBackup ->path . '/unit-test/ ' . $ findDatabase ->database_name_prefix . $ findDatabase ->database_name . '.sql ' ;
95
+ $ this ->assertTrue (file_exists ($ extractedDatabase ));
96
+ $ extractedDatabaseContent = file_get_contents ($ extractedDatabase );
97
+ $ this ->assertNotEmpty ($ extractedDatabaseContent );
98
+
99
+ foreach ($ chs ['databaseTableData ' ] as $ tableName => $ tableData ) {
100
+ $ this ->assertStringContainsString ('CREATE TABLE ` ' . $ tableName . '` ' , $ extractedDatabaseContent );
101
+ foreach ($ tableData as $ data ) {
102
+ $ this ->assertStringContainsString ('INSERT INTO ` ' . $ tableName . '` ' , $ extractedDatabaseContent );
103
+ $ this ->assertStringContainsString ($ data ['name ' ], $ extractedDatabaseContent );
104
+ $ this ->assertStringContainsString ($ data ['email ' ], $ extractedDatabaseContent );
105
+ $ this ->assertStringContainsString ($ data ['phone ' ], $ extractedDatabaseContent );
106
+ }
107
+ }
93
108
94
109
}
95
110
You can’t perform that action at this time.
0 commit comments