Пример #1
0
 /**
  * Try to match a method call to a registered element.
  *
  * An example would be:
  *
  *   $fb->text('title');
  *
  * This call will look for an element with the alias 'text'
  * and once found, it will add it to the current instance
  * of the FormBuilder.
  *
  * @param $alias
  * @param $arguments
  * @throws \ReflectionException
  * @return mixed
  */
 public function __call($alias, $arguments)
 {
     // Check if the element is registered to the container
     $this->container->make($alias);
     $name = current($arguments);
     return $this->element($alias, $name);
 }
Пример #2
0
 /**
  * @param $name
  * @param $class
  * @dataProvider elementProvider
  */
 public function testContainerContainsDefaultElements($name, $class)
 {
     $this->assertInstanceOf($class, $this->container->make($name));
 }