"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/PropertyPathTest.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).

PropertyPathTest.php  (phplist-3.4.5.tgz):PropertyPathTest.php  (phplist-3.4.6.tgz)
skipping to change at line 26 skipping to change at line 26
class PropertyPathTest extends TestCase class PropertyPathTest extends TestCase
{ {
public function testToString() public function testToString()
{ {
$path = new PropertyPath('reference.traversable[index].property'); $path = new PropertyPath('reference.traversable[index].property');
$this->assertEquals('reference.traversable[index].property', $path->__to String()); $this->assertEquals('reference.traversable[index].property', $path->__to String());
} }
/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPro
pertyPathException
*/
public function testDotIsRequiredBeforeProperty() public function testDotIsRequiredBeforeProperty()
{ {
$this->expectException('Symfony\Component\PropertyAccess\Exception\Inval idPropertyPathException');
new PropertyPath('[index]property'); new PropertyPath('[index]property');
} }
/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPro
pertyPathException
*/
public function testDotCannotBePresentAtTheBeginning() public function testDotCannotBePresentAtTheBeginning()
{ {
$this->expectException('Symfony\Component\PropertyAccess\Exception\Inval idPropertyPathException');
new PropertyPath('.property'); new PropertyPath('.property');
} }
public function providePathsContainingUnexpectedCharacters() public function providePathsContainingUnexpectedCharacters()
{ {
return [ return [
['property.'], ['property.'],
['property.['], ['property.['],
['property..'], ['property..'],
['property['], ['property['],
['property[['], ['property[['],
['property[.'], ['property[.'],
['property[]'], ['property[]'],
]; ];
} }
/** /**
* @dataProvider providePathsContainingUnexpectedCharacters * @dataProvider providePathsContainingUnexpectedCharacters
* @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPro pertyPathException
*/ */
public function testUnexpectedCharacters($path) public function testUnexpectedCharacters($path)
{ {
$this->expectException('Symfony\Component\PropertyAccess\Exception\Inval idPropertyPathException');
new PropertyPath($path); new PropertyPath($path);
} }
/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPro
pertyPathException
*/
public function testPathCannotBeEmpty() public function testPathCannotBeEmpty()
{ {
$this->expectException('Symfony\Component\PropertyAccess\Exception\Inval idPropertyPathException');
new PropertyPath(''); new PropertyPath('');
} }
/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidArg
umentException
*/
public function testPathCannotBeNull() public function testPathCannotBeNull()
{ {
$this->expectException('Symfony\Component\PropertyAccess\Exception\Inval idArgumentException');
new PropertyPath(null); new PropertyPath(null);
} }
/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidArg
umentException
*/
public function testPathCannotBeFalse() public function testPathCannotBeFalse()
{ {
$this->expectException('Symfony\Component\PropertyAccess\Exception\Inval idArgumentException');
new PropertyPath(false); new PropertyPath(false);
} }
public function testZeroIsValidPropertyPath() public function testZeroIsValidPropertyPath()
{ {
$propertyPath = new PropertyPath('0'); $propertyPath = new PropertyPath('0');
$this->assertSame('0', (string) $propertyPath); $this->assertSame('0', (string) $propertyPath);
} }
skipping to change at line 131 skipping to change at line 121
$this->assertEquals($propertyPath, $copy); $this->assertEquals($propertyPath, $copy);
} }
public function testGetElement() public function testGetElement()
{ {
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$this->assertEquals('child', $propertyPath->getElement(2)); $this->assertEquals('child', $propertyPath->getElement(2));
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testGetElementDoesNotAcceptInvalidIndices() public function testGetElementDoesNotAcceptInvalidIndices()
{ {
$this->expectException('OutOfBoundsException');
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$propertyPath->getElement(3); $propertyPath->getElement(3);
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testGetElementDoesNotAcceptNegativeIndices() public function testGetElementDoesNotAcceptNegativeIndices()
{ {
$this->expectException('OutOfBoundsException');
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$propertyPath->getElement(-1); $propertyPath->getElement(-1);
} }
public function testIsProperty() public function testIsProperty()
{ {
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$this->assertTrue($propertyPath->isProperty(1)); $this->assertTrue($propertyPath->isProperty(1));
$this->assertFalse($propertyPath->isProperty(2)); $this->assertFalse($propertyPath->isProperty(2));
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testIsPropertyDoesNotAcceptInvalidIndices() public function testIsPropertyDoesNotAcceptInvalidIndices()
{ {
$this->expectException('OutOfBoundsException');
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$propertyPath->isProperty(3); $propertyPath->isProperty(3);
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testIsPropertyDoesNotAcceptNegativeIndices() public function testIsPropertyDoesNotAcceptNegativeIndices()
{ {
$this->expectException('OutOfBoundsException');
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$propertyPath->isProperty(-1); $propertyPath->isProperty(-1);
} }
public function testIsIndex() public function testIsIndex()
{ {
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$this->assertFalse($propertyPath->isIndex(1)); $this->assertFalse($propertyPath->isIndex(1));
$this->assertTrue($propertyPath->isIndex(2)); $this->assertTrue($propertyPath->isIndex(2));
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testIsIndexDoesNotAcceptInvalidIndices() public function testIsIndexDoesNotAcceptInvalidIndices()
{ {
$this->expectException('OutOfBoundsException');
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$propertyPath->isIndex(3); $propertyPath->isIndex(3);
} }
/**
* @expectedException \OutOfBoundsException
*/
public function testIsIndexDoesNotAcceptNegativeIndices() public function testIsIndexDoesNotAcceptNegativeIndices()
{ {
$this->expectException('OutOfBoundsException');
$propertyPath = new PropertyPath('grandpa.parent[child]'); $propertyPath = new PropertyPath('grandpa.parent[child]');
$propertyPath->isIndex(-1); $propertyPath->isIndex(-1);
} }
} }
 End of changes. 24 change blocks. 
39 lines changed or deleted 12 lines changed or added

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