Beispiel #1
0
 /**
  * Set up form
  *
  * @return void
  * @author Dan Cox
  */
 public function configure()
 {
     $this->route = 'form.test';
     $this->method = 'post';
     $model = DI::getContainer()->get('entity')->load('Wasp\\Test\\Entity\\Entities\\Contact');
     $model->name = 'Dan';
     $model->message = 'This is a default message';
     $model->save();
     $this->model = $model;
 }
 /**
  * Converts the collection class into a json string
  *
  * @return String
  * @author Dan Cox
  */
 public function json()
 {
     $serializer = DI::getContainer()->get('serializer');
     return $serializer->serialize($this->collectable, 'json');
 }
Beispiel #3
0
 /**
  * Responds to the current request
  *
  * @return void
  * @author Dan Cox
  **/
 public function respond()
 {
     $response = $this->react();
     $response->send();
     $this->DI->get('kernel')->terminate($this->DI->get('request')->getRequest(), $response);
 }
Beispiel #4
0
 /**
  * Test the extension register function from the DI class
  *
  * @return void
  * @author Dan Cox
  */
 public function test_extensionRegistrar()
 {
     $di = new DI(CONFIG);
     $di->build()->load('core');
     $this->assertInstanceOf('Wasp\\DI\\ExtensionRegister', $di->extensions());
 }
Beispiel #5
0
 /**
  * Configures the form based on its properties
  *
  * @author Dan Cox
  */
 public function __construct()
 {
     $this->container = DI::getContainer();
     $this->name = base64_encode(get_called_class());
     $this->errors = new Collection();
     $this->configure();
     $this->setup();
 }
 /**
  * Setup test environment
  *
  * @return void
  * @author Dan Cox
  */
 public function setUp()
 {
     $di = new DI();
     $di->setDirectory(__DIR__);
     $di->build()->load('service');
 }