Skip to content

Commit

Permalink
CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive committed Sep 9, 2023
1 parent c4a54ad commit 6ab572d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/Services/VerifyDocuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public static function isValidEvidenceFile(array $files)
$validSize = true;
$total_size = 0;

$basic = (1024*1024);
$file_size = $basic*(self::$dispute_evidence_file_size);
$overall_size = $basic*(self::$dispute_evidences_size);
$basic = (1024 * 1024);
$file_size = $basic * self::$dispute_evidence_file_size;
$overall_size = $basic * self::$dispute_evidences_size;

foreach ($files as $file) {
$mime_type = self::getMimeType($file);
Expand Down
12 changes: 6 additions & 6 deletions tests/Feature/AdapterFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ public function it_can_provide_evidence_for_a_dispute_claim()
);

$mockFiles = [
__DIR__ . '/../Mocks/samples/sample.jpg',
__DIR__ . '/../Mocks/samples/sample.png',
__DIR__ . '/../Mocks/samples/sample.pdf',
__DIR__.'/../Mocks/samples/sample.jpg',
__DIR__.'/../Mocks/samples/sample.png',
__DIR__.'/../Mocks/samples/sample.pdf',
];

$response = $this->client->provideDisputeEvidence(
Expand All @@ -378,8 +378,8 @@ public function it_throws_exception_if_invalid_file_as_evidence_is_provided_for_
);

$mockFiles = [
__DIR__ . '/../Mocks/samples/sample.txt',
__DIR__ . '/../Mocks/samples/sample.pdf',
__DIR__.'/../Mocks/samples/sample.txt',
__DIR__.'/../Mocks/samples/sample.pdf',
];

$this->expectException(\Exception::class);
Expand All @@ -404,7 +404,7 @@ public function it_throws_exception_if_file_size_as_evidence_exceeds_per_file_li
)
);

$file = __DIR__ . '/../Mocks/samples/sample2.pdf';
$file = __DIR__.'/../Mocks/samples/sample2.pdf';

$mockFiles = [$file];

Expand Down
13 changes: 0 additions & 13 deletions tests/MockClientClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,4 @@ private function getApiCredentials(): array
'validate_ssl' => true,
];
}

private function generateFile($path, $size)
{
$fh = fopen($path, 'w');

$size *= pow(1024, 2);
$chunk = 1024;
while ($size > 0) {
fputs($fh, str_pad('', min($chunk,$size)));
$size -= $chunk;
}
fclose($fh);
}
}

0 comments on commit 6ab572d

Please sign in to comment.