Example #1
0
 public function testWithAttibute()
 {
     $this->if($generator = new asserter\generator())->and($parent = new CrawlerAssert($generator))->and($object = new TestedClass($generator, $parent))->and($attribute = uniqid())->and($value = uniqid())->then->object($object->withAttribute($attribute, $value))->isIdenticalTo($object)->array($object->getAttributes())->isIdenticalTo(array($attribute => $value))->if($otherAttribute = uniqid())->and($otherValue = uniqid())->then->object($object->withAttribute($otherAttribute, $otherValue))->isIdenticalTo($object)->array($object->getAttributes())->isIdenticalTo(array($attribute => $value, $otherAttribute => $otherValue));
 }
Example #2
0
 public function testWithAttibute()
 {
     $this->if($object = new TestedClass())->and($attribute = uniqid())->and($value = uniqid())->then->object($object->withAttribute($attribute, $value))->isIdenticalTo($object)->array($object->getAttributes())->isIdenticalTo(array($attribute => $value))->if($otherAttribute = uniqid())->and($otherValue = uniqid())->then->object($object->withAttribute($otherAttribute, $otherValue))->isIdenticalTo($object)->array($object->getAttributes())->isIdenticalTo(array($attribute => $value, $otherAttribute => $otherValue));
 }