/** * 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'); }
/** * 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); }
/** * 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()); }
/** * 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'); }