This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +72
-13
lines changed
Expand file tree Collapse file tree 3 files changed +72
-13
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ public function mixedValueProvider()
208208 {
209209 $ dataSets = parent ::mixedValueProvider ();
210210 array_walk ($ dataSets , function (&$ set ) {
211- $ set [0 ] = [$ set [0 ]]; // Wrap value into an array.
211+ $ set [' raw ' ] = [$ set [' raw ' ]]; // Wrap value into an array.
212212 });
213213
214214 return $ dataSets ;
Original file line number Diff line number Diff line change @@ -456,4 +456,25 @@ public function emptyValueProvider()
456456 ],
457457 ];
458458 }
459+
460+ public function mixedValueProvider ()
461+ {
462+ $ fooUploadErrOk = [
463+ 'tmp_name ' => 'foo ' ,
464+ 'error ' => UPLOAD_ERR_OK ,
465+ ];
466+
467+ return [
468+ 'single ' => [
469+ 'raw ' => $ fooUploadErrOk ,
470+ 'filtered ' => $ fooUploadErrOk ,
471+ ],
472+ 'multi ' => [
473+ 'raw ' => [
474+ $ fooUploadErrOk ,
475+ ],
476+ 'filtered ' => $ fooUploadErrOk ,
477+ ],
478+ ];
479+ }
459480}
Original file line number Diff line number Diff line change @@ -350,6 +350,8 @@ public function testIsRequiredVsAllowEmptyVsContinueIfEmptyVsIsValid(
350350 'isValid() value not match. Detail: ' . json_encode ($ this ->input ->getMessages ())
351351 );
352352 $ this ->assertEquals ($ expectedMessages , $ this ->input ->getMessages (), 'getMessages() value not match ' );
353+ $ this ->assertEquals ($ value , $ this ->input ->getRawValue (), 'getRawValue() must return the value always ' );
354+ $ this ->assertEquals ($ value , $ this ->input ->getValue (), 'getValue() must return the filtered value always ' );
353355 }
354356
355357 /**
@@ -551,19 +553,55 @@ public function mixedValueProvider()
551553 {
552554 return [
553555 // Description => [$value]
554- '"0" ' => ['0 ' ],
555- '0 ' => [0 ],
556- '0.0 ' => [0.0 ],
557- 'false ' => [false ],
558- 'php ' => ['php ' ],
559- 'whitespace ' => [' ' ],
560- '1 ' => [1 ],
561- '1.0 ' => [1.0 ],
562- 'true ' => [true ],
563- '["php"] ' => [['php ' ]],
564- 'object ' => [new stdClass ()],
556+ '"0" ' => [
557+ 'raw ' => '0 ' ,
558+ 'filtered ' => '0 ' ,
559+ ],
560+ '0 ' => [
561+ 'raw ' => 0 ,
562+ 'filtered ' => 0 ,
563+ ],
564+ '0.0 ' => [
565+ 'raw ' => 0.0 ,
566+ 'filtered ' => 0.0 ,
567+ ],
568+ 'false ' => [
569+ 'raw ' => false ,
570+ 'filtered ' => false ,
571+ ],
572+ 'php ' => [
573+ 'raw ' => 'php ' ,
574+ 'filtered ' => 'php ' ,
575+ ],
576+ 'whitespace ' => [
577+ 'raw ' => ' ' ,
578+ 'filtered ' => ' ' ,
579+ ],
580+ '1 ' => [
581+ 'raw ' => 1 ,
582+ 'filtered ' => 1 ,
583+ ],
584+ '1.0 ' => [
585+ 'raw ' => 1.0 ,
586+ 'filtered ' => 1.0 ,
587+ ],
588+ 'true ' => [
589+ 'raw ' => true ,
590+ 'filtered ' => true ,
591+ ],
592+ '["php"] ' => [
593+ 'raw ' => ['php ' ],
594+ 'filtered ' => ['php ' ],
595+ ],
596+ 'object ' => [
597+ 'raw ' => new stdClass (),
598+ 'filtered ' => new stdClass (),
599+ ],
565600 // @codingStandardsIgnoreStart
566- 'callable ' => [function () {}],
601+ 'callable ' => [
602+ 'raw ' => function () {},
603+ 'filtered ' => function () {},
604+ ],
567605 // @codingStandardsIgnoreEnd
568606 ];
569607 }
You can’t perform that action at this time.
0 commit comments