"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.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).

PropertyPathBuilderTest.php  (phplist-3.4.5.tgz):PropertyPathBuilderTest.php  (phplist-3.4.6.tgz)
skipping to change at line 119 skipping to change at line 119
public function testReplaceByIndexWithoutName() public function testReplaceByIndexWithoutName()
{ {
$this->builder->replaceByIndex(0); $this->builder->replaceByIndex(0);
$path = new PropertyPath('[old1][old2].old3[old4][old5].old6'); $path = new PropertyPath('[old1][old2].old3[old4][old5].old6');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testReplaceByIndexDoesNotAllowInvalidOffsets() public function testReplaceByIndexDoesNotAllowInvalidOffsets()
{ {
$this->expectException('OutOfBoundsException');
$this->builder->replaceByIndex(6, 'new1'); $this->builder->replaceByIndex(6, 'new1');
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testReplaceByIndexDoesNotAllowNegativeOffsets() public function testReplaceByIndexDoesNotAllowNegativeOffsets()
{ {
$this->expectException('OutOfBoundsException');
$this->builder->replaceByIndex(-1, 'new1'); $this->builder->replaceByIndex(-1, 'new1');
} }
public function testReplaceByProperty() public function testReplaceByProperty()
{ {
$this->builder->replaceByProperty(1, 'new1'); $this->builder->replaceByProperty(1, 'new1');
$path = new PropertyPath('old1.new1.old3[old4][old5].old6'); $path = new PropertyPath('old1.new1.old3[old4][old5].old6');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
skipping to change at line 153 skipping to change at line 149
public function testReplaceByPropertyWithoutName() public function testReplaceByPropertyWithoutName()
{ {
$this->builder->replaceByProperty(1); $this->builder->replaceByProperty(1);
$path = new PropertyPath('old1.old2.old3[old4][old5].old6'); $path = new PropertyPath('old1.old2.old3[old4][old5].old6');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testReplaceByPropertyDoesNotAllowInvalidOffsets() public function testReplaceByPropertyDoesNotAllowInvalidOffsets()
{ {
$this->expectException('OutOfBoundsException');
$this->builder->replaceByProperty(6, 'new1'); $this->builder->replaceByProperty(6, 'new1');
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testReplaceByPropertyDoesNotAllowNegativeOffsets() public function testReplaceByPropertyDoesNotAllowNegativeOffsets()
{ {
$this->expectException('OutOfBoundsException');
$this->builder->replaceByProperty(-1, 'new1'); $this->builder->replaceByProperty(-1, 'new1');
} }
public function testReplace() public function testReplace()
{ {
$this->builder->replace(1, 1, new PropertyPath('new1[new2].new3')); $this->builder->replace(1, 1, new PropertyPath('new1[new2].new3'));
$path = new PropertyPath('old1.new1[new2].new3.old3[old4][old5].old6'); $path = new PropertyPath('old1.new1[new2].new3.old3[old4][old5].old6');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
skipping to change at line 198 skipping to change at line 190
{ {
$this->builder->replace(-1, 1, new PropertyPath('new1[new2].new3')); $this->builder->replace(-1, 1, new PropertyPath('new1[new2].new3'));
$path = new PropertyPath('old1[old2].old3[old4][old5].new1[new2].new3'); $path = new PropertyPath('old1[old2].old3[old4][old5].new1[new2].new3');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
} }
/** /**
* @dataProvider provideInvalidOffsets * @dataProvider provideInvalidOffsets
* @expectedException \OutOfBoundsException
*/ */
public function testReplaceDoesNotAllowInvalidOffsets($offset) public function testReplaceDoesNotAllowInvalidOffsets($offset)
{ {
$this->expectException('OutOfBoundsException');
$this->builder->replace($offset, 1, new PropertyPath('new1[new2].new3')) ; $this->builder->replace($offset, 1, new PropertyPath('new1[new2].new3')) ;
} }
public function provideInvalidOffsets() public function provideInvalidOffsets()
{ {
return [ return [
[6], [6],
[-7], [-7],
]; ];
} }
skipping to change at line 273 skipping to change at line 265
public function testRemove() public function testRemove()
{ {
$this->builder->remove(3); $this->builder->remove(3);
$path = new PropertyPath('old1[old2].old3[old5].old6'); $path = new PropertyPath('old1[old2].old3[old5].old6');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testRemoveDoesNotAllowInvalidOffsets() public function testRemoveDoesNotAllowInvalidOffsets()
{ {
$this->expectException('OutOfBoundsException');
$this->builder->remove(6); $this->builder->remove(6);
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testRemoveDoesNotAllowNegativeOffsets() public function testRemoveDoesNotAllowNegativeOffsets()
{ {
$this->expectException('OutOfBoundsException');
$this->builder->remove(-1); $this->builder->remove(-1);
} }
public function testRemoveAndAppendAtTheEnd() public function testRemoveAndAppendAtTheEnd()
{ {
$this->builder->remove($this->builder->getLength() - 1); $this->builder->remove($this->builder->getLength() - 1);
$path = new PropertyPath('old1[old2].old3[old4][old5]'); $path = new PropertyPath('old1[old2].old3[old4][old5]');
$this->assertEquals($path, $this->builder->getPropertyPath()); $this->assertEquals($path, $this->builder->getPropertyPath());
 End of changes. 14 change blocks. 
19 lines changed or deleted 7 lines changed or added

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