Skip to content

Commit

Permalink
revert deletion of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robertotcestari committed Aug 22, 2024
1 parent db828e2 commit e1760a7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/Validation/ValidationValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4846,6 +4846,12 @@ public function testValidateImage()
$v = new Validator($trans, ['x' => $file2], ['x' => 'image']);
$this->assertTrue($v->passes());

$file2 = $this->getMockBuilder(UploadedFile::class)->onlyMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
$file2->expects($this->any())->method('guessExtension')->willReturn('jpg');
$file2->expects($this->any())->method('getClientOriginalExtension')->willReturn('jpg');
$v = new Validator($trans, ['x' => $file2], ['x' => 'image']);
$this->assertTrue($v->passes());

$file3 = $this->getMockBuilder(UploadedFile::class)->onlyMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
$file3->expects($this->any())->method('guessExtension')->willReturn('gif');
$file3->expects($this->any())->method('getClientOriginalExtension')->willReturn('gif');
Expand Down Expand Up @@ -4877,10 +4883,10 @@ public function testValidateImage()
$v = new Validator($trans, ['x' => $file7], ['x' => 'Image']);
$this->assertTrue($v->passes());

$file8 = $this->getMockBuilder(UploadedFile::class)->onlyMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
$file8->expects($this->any())->method('guessExtension')->willReturn('avif');
$file8->expects($this->any())->method('getClientOriginalExtension')->willReturn('avif');
$v = new Validator($trans, ['x' => $file8], ['x' => 'Image']);
$file2 = $this->getMockBuilder(UploadedFile::class)->onlyMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
$file2->expects($this->any())->method('guessExtension')->willReturn('jpg');
$file2->expects($this->any())->method('getClientOriginalExtension')->willReturn('jpg');
$v = new Validator($trans, ['x' => $file2], ['x' => 'Image']);
$this->assertTrue($v->passes());
}

Expand Down Expand Up @@ -9501,4 +9507,4 @@ class ExplicitTableAndConnectionModel extends Model

class NonEloquentModel
{
}
}

0 comments on commit e1760a7

Please sign in to comment.