public function testSetAction()
 {
     $d = new ServiceDescription('https://example.com/router');
     $a1 = new ActionDescription('action1', array(new MethodDescription('method1')));
     $d->addAction($a1);
     $a2 = new ActionDescription('action2', array(new MethodDescription('method1')));
     $a3 = new ActionDescription('action3', array(new MethodDescription('method1')));
     $d->setActions(array($a2, $a3));
     $this->assertCount(2, $d->getActions());
     $this->assertJsonStringEqualsJsonString(json_encode(array('type' => 'remoting', 'url' => 'https://example.com/router', 'namespace' => 'Ext.global', 'actions' => array('action2' => array(array('name' => 'method1', 'len' => 0)), 'action3' => array(array('name' => 'method1', 'len' => 0))))), json_encode($d));
 }