Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / validator / Tests / Constraints / FileTest.php
index fdecdc7cc1f45d4bc254dc840a72d64224ab29d6..b7745f44fa13a2bc19b0461e3291601c90e1fe44 100644 (file)
@@ -18,9 +18,6 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
 class FileTest extends TestCase
 {
     /**
-     * @param mixed $maxSize
-     * @param int   $bytes
-     * @param bool  $binaryFormat
      * @dataProvider provideValidSizes
      */
     public function testMaxSize($maxSize, $bytes, $binaryFormat)
@@ -29,14 +26,20 @@ class FileTest extends TestCase
 
         $this->assertSame($bytes, $file->maxSize);
         $this->assertSame($binaryFormat, $file->binaryFormat);
+        $this->assertTrue($file->__isset('maxSize'));
+    }
+
+    public function testMagicIsset()
+    {
+        $file = new File(array('maxSize' => 1));
+
+        $this->assertTrue($file->__isset('maxSize'));
+        $this->assertTrue($file->__isset('groups'));
+        $this->assertFalse($file->__isset('toto'));
     }
 
     /**
      * @dataProvider provideValidSizes
-     *
-     * @param int|string $maxSize
-     * @param int        $bytes
-     * @param string     $binaryFormat
      */
     public function testMaxSizeCanBeSetAfterInitialization($maxSize, $bytes, $binaryFormat)
     {
@@ -50,8 +53,6 @@ class FileTest extends TestCase
     /**
      * @dataProvider provideInvalidSizes
      * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
-     *
-     * @param int|string $maxSize
      */
     public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization($maxSize)
     {
@@ -61,8 +62,6 @@ class FileTest extends TestCase
 
     /**
      * @dataProvider provideInvalidSizes
-     *
-     * @param int|string $maxSize
      */
     public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($maxSize)
     {
@@ -77,7 +76,6 @@ class FileTest extends TestCase
     }
 
     /**
-     * @param mixed $maxSize
      * @dataProvider provideInValidSizes
      * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
      */
@@ -86,9 +84,6 @@ class FileTest extends TestCase
         new File(array('maxSize' => $maxSize));
     }
 
-    /**
-     * @return array
-     */
     public function provideValidSizes()
     {
         return array(
@@ -105,9 +100,6 @@ class FileTest extends TestCase
         );
     }
 
-    /**
-     * @return array
-     */
     public function provideInvalidSizes()
     {
         return array(
@@ -121,9 +113,6 @@ class FileTest extends TestCase
     }
 
     /**
-     * @param mixed $maxSize
-     * @param bool  $guessedFormat
-     * @param bool  $binaryFormat
      * @dataProvider provideFormats
      */
     public function testBinaryFormat($maxSize, $guessedFormat, $binaryFormat)
@@ -133,9 +122,6 @@ class FileTest extends TestCase
         $this->assertSame($binaryFormat, $file->binaryFormat);
     }
 
-    /**
-     * @return array
-     */
     public function provideFormats()
     {
         return array(