39 lines
3.6 KiB
PHP
Executable File
39 lines
3.6 KiB
PHP
Executable File
<?php
|
|
require_once 'vendor/autoload.php';
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use App\Helpers\ExcelMergeHelper;
|
|
|
|
class ExcelMergeHelperTest extends TestCase
|
|
{
|
|
public function testMergeExcelFiles_Success()
|
|
{
|
|
// Use the paths you provided
|
|
$filePaths = [
|
|
['file_path' =>'/home/venba/Downloads/RFQ_qw_Office Package_20250326112828.xlsx','sheets' => []],
|
|
|
|
['file_path' =>'/home/venba/Downloads/RFQ_qw_Office Package_20250326112828 (copy).xlsx','sheets' => []],
|
|
|
|
// ['file_path' =>'/home/venba/Downloads/Employee_data.xlsx','sheets' => []],
|
|
];
|
|
$outputPath = '/home/venba/Documents/merged_file.xlsx'; // Output path for the merged file
|
|
|
|
// Call the mergeExcelFiles function
|
|
$result = ExcelMergeHelper::mergeExcelFiles($filePaths, $outputPath);
|
|
echo('result is -> '.$result);
|
|
// Check if the result is true (indicating success)
|
|
$this->assertFileExists($result);
|
|
$this->assertTrue(filesize($result) > 0);
|
|
}
|
|
|
|
}
|
|
// $temp_file_path = WRITEPATH.'tmp/RFQ_ABC_GMC_20241219172307.xlsx';
|
|
// $temp_file_name = 'RFQ_ABC_GMC_20241219172307.xlsx';
|
|
// $lead_file_path = WRITEPATH.'uploads/lead_files/Member_Data.xlsx';
|
|
|
|
// $filePaths = [
|
|
// ['file_path' => $temp_file_path,'sheets' =>[]],
|
|
// ['file_path' =>$lead_file_path ,'sheets' =>[]]
|
|
// ];
|
|
// $outputPath = dirname($temp_file_path).'/'.$temp_file_name.'_merged';
|