Example #1
0
 public function test_it_updates()
 {
     $expectedJson = ['router' => ['name' => 'new', 'external_gateway_info' => ["network_id" => "8ca37218-28ff-41cb-9b10-039601ea7e6b", "enable_snat" => true, "external_fixed_ips" => [["subnet_id" => "255.255.255.0", "ip" => "192.168.10.1"]]]]];
     $this->setupMock('PUT', 'v2.0/routers/id', $expectedJson, [], new Response(201));
     $gatewayInfo = new GatewayInfo();
     $gatewayInfo->networkId = '8ca37218-28ff-41cb-9b10-039601ea7e6b';
     $gatewayInfo->enableSnat = true;
     $fixedIp = new FixedIp();
     $fixedIp->subnetId = '255.255.255.0';
     $fixedIp->ip = '192.168.10.1';
     $gatewayInfo->fixedIps = [$fixedIp];
     $this->router->externalGatewayInfo = $gatewayInfo;
     $this->router->name = 'new';
     $this->router->update();
 }