Example #1
0
 public function setUp()
 {
     MockPaths::createMockPaths();
     $this->application = new Application(MockPaths::$basePath);
     $this->router = $this->application->make(\Core\Router\Router::class, $this->application, 'Router');
     //$service = $this->application->register('Router', \Core\Router\Router::class);
     //$service->setArguments([$this->application]);
     $this->setRoutes();
     parent::setUp();
 }
Example #2
0
 /**
  * @covers \Core\Contracts\Database\LanguageContract::create
  * @covers \Core\Database\Language\MySqlLanguage::create
  */
 public function setUp()
 {
     MockPaths::createMockPaths();
     $this->app = new Application(MockPaths::$basePath);
     $this->app->setEnvironment('test');
     $language = $this->getMapping();
     $table = $this->getTableSchema();
     $table2 = $this->getTable2Schema();
     $phoneTable = $this->getPhoneTableSchema();
     $postsTable = $this->getPostsTableSchema();
     $commentsTable = $this->getCommentsTableSchema();
     $employeeTable = $this->getEmployeeSchema();
     $educationTable = $this->getEducationSchema();
     $education_employeeTable = $this->getEmployee_Education_Schema();
     $language->create($table);
     $language->create($table2);
     $language->create($phoneTable);
     $language->create($postsTable);
     $language->create($commentsTable);
     $language->create($employeeTable);
     $language->create($educationTable);
     $language->create($education_employeeTable);
     $language->insert($table, $this->data);
     $language->insert($table2, $this->data);
     $language->insert($phoneTable, $this->phoneData);
     $language->insert($postsTable, $this->postData);
     $language->insert($commentsTable, $this->commentsData);
     $language->insert($employeeTable, $this->employeeData);
     $language->insert($educationTable, $this->educationData);
     $language->insert($education_employeeTable, $this->employee_education_data);
     parent::setUp();
 }
Example #3
0
 public function setUp()
 {
     MockPaths::createMockPaths();
     $this->app = new Application(MockPaths::$basePath);
     parent::setUp();
 }
Example #4
0
 /**
  * @covers \Core\Application\BaseApplication::run
  * @covers \Core\Application\BaseApplication::setRequest
  * @covers \Core\Request\Request::create
  * @covers \Core\Facade\Router::get
  */
 public function testIfControllersCanReturnView()
 {
     MockPaths::createMockPaths();
     $app = new Application(MockPaths::$basePath);
     Router::get('/user/{name}', '\\Core\\Tests\\Stubs\\Controllers\\StubController@testReturnView');
     $app->setRequest(Request::create('http://example.com/user/sam'));
     $app->run();
     $this->assertTrue(headers_sent());
     $this->expectOutputString("Hello sam");
 }