public function testFieldDefaultState() { $object = new FirewallClass(); $this->boolean($object->getDefaultState())->isFalse()->object($object->setDefaultState(true))->isInstanceOf('M6Web\\Component\\Firewall\\Firewall')->boolean($object->getDefaultState())->isTrue()->exception(function () use($object) { $object->setDefaultState('faux boolean'); })->isInstanceOf('InvalidArgumentException')->boolean($object->getDefaultState())->isTrue(); }
/** * Add new IP addresses or ranges to allow to deploy * * @param array $ips list of IP addresses or ranges (CIDR) * @return self itself for method chaining */ public function allowIpAddresses(array $ips) { static $counter = 0; $list = 'list' . $counter++; $this->firewall->addList($ips, $list, true); $this->firewall->setDefaultState(false); return $this; }