"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/FileTest.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

FileTest.php  (phplist-3.4.5.tgz):FileTest.php  (phplist-3.4.6.tgz)
skipping to change at line 55 skipping to change at line 55
{ {
$file = new File(); $file = new File();
$file->maxSize = $maxSize; $file->maxSize = $maxSize;
$this->assertSame($bytes, $file->maxSize); $this->assertSame($bytes, $file->maxSize);
$this->assertSame($binaryFormat, $file->binaryFormat); $this->assertSame($binaryFormat, $file->binaryFormat);
} }
/** /**
* @dataProvider provideInvalidSizes * @dataProvider provideInvalidSizes
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefin itionException
*/ */
public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization ($maxSize) public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization ($maxSize)
{ {
$this->expectException('Symfony\Component\Validator\Exception\Constraint DefinitionException');
$file = new File(['maxSize' => 1000]); $file = new File(['maxSize' => 1000]);
$file->maxSize = $maxSize; $file->maxSize = $maxSize;
} }
/** /**
* @dataProvider provideInvalidSizes * @dataProvider provideInvalidSizes
*/ */
public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($max Size) public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($max Size)
{ {
$file = new File(['maxSize' => 1000]); $file = new File(['maxSize' => 1000]);
skipping to change at line 80 skipping to change at line 80
try { try {
$file->maxSize = $maxSize; $file->maxSize = $maxSize;
} catch (ConstraintDefinitionException $e) { } catch (ConstraintDefinitionException $e) {
} }
$this->assertSame(1000, $file->maxSize); $this->assertSame(1000, $file->maxSize);
} }
/** /**
* @dataProvider provideInValidSizes * @dataProvider provideInValidSizes
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefin itionException
*/ */
public function testInvalidMaxSize($maxSize) public function testInvalidMaxSize($maxSize)
{ {
$this->expectException('Symfony\Component\Validator\Exception\Constraint DefinitionException');
new File(['maxSize' => $maxSize]); new File(['maxSize' => $maxSize]);
} }
public function provideValidSizes() public function provideValidSizes()
{ {
return [ return [
['500', 500, false], ['500', 500, false],
[12300, 12300, false], [12300, 12300, false],
['1ki', 1024, true], ['1ki', 1024, true],
['1KI', 1024, true], ['1KI', 1024, true],
 End of changes. 4 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)