Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbcb79a3

Browse files
author
Amrouche Hamza
committed
[Validator] add missing parent isset and add test
1 parent8e8ee09 commitbcb79a3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

‎src/Symfony/Component/Validator/Constraint.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ public function __get($option)
214214
thrownewInvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s',$option,get_class($this)),array($option));
215215
}
216216

217+
/**
218+
* @param string $option The option name
219+
*
220+
* @return bool
221+
*/
222+
publicfunction__isset($option)
223+
{
224+
return'groups' ===$option;
225+
}
226+
217227
/**
218228
* Adds the given group if this constraint is in the Default group.
219229
*

‎src/Symfony/Component/Validator/Tests/Constraints/FileTest.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public function testMaxSize($maxSize, $bytes, $binaryFormat)
2626

2727
$this->assertSame($bytes,$file->maxSize);
2828
$this->assertSame($binaryFormat,$file->binaryFormat);
29+
$this->assertTrue($file->__isset('maxSize'));
30+
}
31+
32+
publicfunctiontestMagicIsset()
33+
{
34+
$file =newFile(array('maxSize' =>1));
35+
36+
$this->assertTrue($file->__isset('maxSize'));
37+
$this->assertTrue($file->__isset('groups'));
38+
$this->assertFalse($file->__isset('toto'));
2939
}
3040

3141
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp