public function testPackingWhenSomeIndexesAreNumeric()
 {
     $valueFactoryMock = $this->getValueFactoryMock();
     $typeInstance = new ObjectType($valueFactoryMock);
     $domElement = $typeInstance->pack(new \DOMDocument(), array('numericValue'));
     $this->assertEquals(array('value' => array('struct' => array('member' => array('name' => 'i0', 'value' => 'numericValue')))), array($domElement->tagName => XmlAssertHelper::xml2array($domElement)));
 }
 public function testPacking()
 {
     $implementationMock = $this->getMock("Seven\\RpcBundle\\XmlRpc\\Implementation");
     $implementationMock->expects($this->any())->method('pack')->will($this->returnCallback(function ($document) {
         /** @var $document \DOMDocument */
         return $document->createElement('test', 'test');
     }));
     $typeInstance = new ArrayType($implementationMock);
     $domElement = $typeInstance->pack(new \DOMDocument(), array('value'));
     $this->assertEquals(array('value' => array('array' => array('data' => array('test' => 'test')))), array($domElement->tagName => XmlAssertHelper::xml2array($domElement)));
 }
 public function testPacking()
 {
     $typeInstance = new IntegerType($this->getMock("Seven\\RpcBundle\\XmlRpc\\Implementation"));
     $domElement = $typeInstance->pack(new \DOMDocument(), 123);
     $this->assertEquals(array('value' => array('int' => 123)), array($domElement->tagName => XmlAssertHelper::xml2array($domElement)));
 }
 public function testPacking()
 {
     $typeInstance = new StringType($this->getMock("Seven\\RpcBundle\\XmlRpc\\Implementation"));
     $domElement = $typeInstance->pack(new \DOMDocument(), "s-t-r-i-n-g");
     $this->assertEquals(array('value' => array('string' => 's-t-r-i-n-g')), array($domElement->tagName => XmlAssertHelper::xml2array($domElement)));
 }
 public function testPacking()
 {
     $typeInstance = new DateType($this->getMock("Seven\\RpcBundle\\XmlRpc\\Implementation"));
     $domElement = $typeInstance->pack(new \DOMDocument(), new \DateTime("12/31/2010 12:34:50"));
     $this->assertEquals(array('value' => array('dateTime.iso8601' => '20101231T12:34:50')), array($domElement->tagName => XmlAssertHelper::xml2array($domElement)));
 }