|
|
|
@ -124,9 +124,9 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $child->getName() . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testFollowDotRules()
|
|
|
|
@ -149,9 +149,9 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $grandGrandChild->getErrors(), $grandGrandChild->getName() . ' should have an error, but has none');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -172,9 +172,9 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testAbortVirtualFormMappingIfNotSynchronized()
|
|
|
|
@ -194,9 +194,9 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testAbortDotRuleMappingIfNotSynchronized()
|
|
|
|
@ -218,9 +218,9 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function provideDefaultTests()
|
|
|
|
@ -732,15 +732,15 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
if (self::LEVEL_0 === $target) {
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} elseif (self::LEVEL_1 === $target) {
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} else {
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1199,20 +1199,20 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
if ($target !== self::LEVEL_0) {
|
|
|
|
|
$this->assertFalse($distraction->hasErrors(), 'distraction should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $distraction->getErrors(), 'distraction should not have an error, but has one');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (self::LEVEL_0 === $target) {
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} elseif (self::LEVEL_1 === $target) {
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} else {
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1385,24 +1385,24 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
$this->mapper->mapViolation($violation, $parent);
|
|
|
|
|
|
|
|
|
|
if (self::LEVEL_0 === $target) {
|
|
|
|
|
$this->assertFalse($errorChild->hasErrors(), $errorName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $errorChild->getErrors(), $errorName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} elseif (self::LEVEL_1 === $target) {
|
|
|
|
|
$this->assertFalse($errorChild->hasErrors(), $errorName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $errorChild->getErrors(), $errorName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} elseif (self::LEVEL_1B === $target) {
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $errorChild->getErrors(), $errorName . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} else {
|
|
|
|
|
$this->assertFalse($errorChild->hasErrors(), $errorName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $errorChild->getErrors(), $errorName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1449,15 +1449,15 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
|
|
|
|
|
if (self::LEVEL_0 === $target) {
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} elseif (self::LEVEL_1 === $target) {
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none');
|
|
|
|
|
$this->assertFalse($grandChild->hasErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one');
|
|
|
|
|
} else {
|
|
|
|
|
$this->assertFalse($parent->hasErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertFalse($child->hasErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one');
|
|
|
|
|
$this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one');
|
|
|
|
|
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|