コード例 #1
0
 /**
  * @test
  */
 public function itShouldCheckIfIsBetween()
 {
     $this->assertTrue(FileUploadValidation::isBetween('image', 0, 1, 'MB', true));
     $this->assertFalse(FileUploadValidation::isBetween('image', 1, 2, 'MB'));
     $_FILES = ['image' => ['name' => 'sample.png', 'type' => 'image/png', 'tmp_name' => \realpath(\dirname(__FILE__)) . '/resources/phpGpKMlf', 'error' => '0', 'size' => '2000003868']];
     $this->setExpectedException('\\NilPortugues\\Validator\\Validation\\FileUpload\\FileUploadException');
     FileUploadValidation::isBetween('image', 1, 2, 'MB');
 }
 /**
  * @test
  */
 public function itShouldCheckIfIsBetween()
 {
     $this->assertTrue(FileUploadValidation::isBetween('image', 0, 2, 'MB', true));
 }
 /**
  * @test
  */
 public function testFilesVariableEmptyForIsBetween()
 {
     $this->assertFalse(FileUploadValidation::isBetween('property', 0, 1, 'MB'));
 }