Пример #1
0
 public function testCountItems()
 {
     $bag = new Bag();
     $bag->set("foo", "foo");
     $bag->set("bar", "bar");
     $this->assertEquals(2, $bag->count());
 }
Пример #2
0
 /**
  * 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++;
         }
     }
 }
Пример #3
0
 /**
  * for each application, register eventsubscriber (application)
  */
 private function registerSubscribers()
 {
     foreach ($this->applications->all() as $event => $application) {
         $this->eventDispatcher->addSubscriber($application);
     }
 }