Exemplo n.º 1
0
 public function testUnsetCookie()
 {
     $scope = new \Niysu\Scope(['log' => $this->logger, 'request' => new \Niysu\HTTPRequestCustom('/', 'GET'), 'response' => new \Niysu\HTTPResponseStorage()]);
     $cookiesService = $scope->call(__NAMESPACE__ . '\\CookiesContext');
     $cookiesService->test = 10;
     unset($cookiesService->test);
     $this->assertEquals(0, count($cookiesService->getCookiesList()));
 }
Exemplo n.º 2
0
 protected function setUp()
 {
     $scope = new \Niysu\Scope();
     $this->service = $scope->call(__NAMESPACE__ . '\\DatabaseService');
     $this->service->setDatabase('sqlite::memory:');
     try {
         $this->service->execute('CREATE TABLE test (id INTEGER)');
     } catch (\Exception $e) {
         $this->service->execute('DELETE FROM test WHERE 1');
     }
 }