/** * @return Port[] */ public function getPorts() { $ret = array(); $port = $this->api->module_port(); foreach ($port->all(array('lease' => $this->id)) as $port) { $ret[] = new Port($port, $this->api); } return $ret; }
/** * @return ACL[] */ function getACLs() { $ret = array(); $target = $this->getAclType(); $module = $this->api->module_acl($target); foreach ($module->all(array('port' => $this->id)) as $module) { $ret[] = new ACL($module, $this->api, $target); } return $ret; }
function testInsert() { //Setup $value = array('protocol' => 1); //not complete //Assert $client = $this->getMock(self::API_CLIENT); $client->expects($this->once())->method('execute')->with($this->equalTo('Port'), $this->equalTo('insert'), $this->equalTo(array('value' => $value))); //Do $api = new X4BApi($client); $api->module_port()->insert($value); }
/** * @return \Splitice\X4B\Modules\AclApiModule */ protected function moduleApi() { return $this->api->module_acl($this->target); }