Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function mock($key, $numberOfElements = 1)
 {
     if ($numberOfElements === 1) {
         return $this->container->get($key);
     }
     $values = [];
     while ($numberOfElements > 0) {
         $values[] = $this->container->get($key);
         --$numberOfElements;
     }
     return $values;
 }
Esempio n. 2
0
 /**
  * Define a new mock method.
  *
  * @param string $name The name of the method
  *
  * @return Method
  */
 public function method($name)
 {
     $method = new Method($name);
     $this->container->put($name, $method);
     return $method;
 }