public function testCountItems() { $bag = new Bag(); $bag->set("foo", "foo"); $bag->set("bar", "bar"); $this->assertEquals(2, $bag->count()); }
/** * Prepare arguments, rewrite parameters and options to properties * * @param array $argv */ private function prepareArguments(array $argv) { $optionsCount = 0; foreach ($argv as $arg) { if (preg_match_all("/^--([a-zA-Z0-9.]+)=([^.*]+)\$/", $arg, $matches)) { $this->parameters->set($matches[1][0], $matches[2][0]); } if (preg_match_all("/^(-|)([a-zA-Z0-9.]+)/", $arg, $matches)) { $this->options->set($optionsCount, $matches[2][0]); $optionsCount++; } } }
/** * for each application, register eventsubscriber (application) */ private function registerSubscribers() { foreach ($this->applications->all() as $event => $application) { $this->eventDispatcher->addSubscriber($application); } }