Ejemplo n.º 1
0
 public function testTagTypeLostOnClone()
 {
     $ivr = new Ivr();
     $dialplan = $ivr->getDialplan();
     $tag = $dialplan->Amd();
     $cloneTag = $tag->cloneNode();
     $this->assertNotInstanceOf(get_class($tag), $cloneTag);
 }
 /**
  * Test hydration of each tag type
  *
  * @dataProvider provideTagNames
  * 
  * @param string $tagName
  */
 public function testHydration($tagName)
 {
     $ivr = new Ivr();
     $dialplan = $ivr->getDialplan();
     $tag = $dialplan->{$tagName}();
     $hydrator = $tag->getHydrator();
     $fields = $hydrator->extract($tag);
     foreach ($fields as &$value) {
         $value = ' ';
     }
     $hydrator->hydrate($fields, $tag);
     $idempotentFields = $hydrator->extract($tag);
     $this->assertEquals($fields, $idempotentFields);
 }