Browse Source

updated Libraries/Aauth & Aauth/LoginTest

v3-dev
REJack 6 years ago
parent
commit
4002582d69
No known key found for this signature in database
GPG Key ID: 4A44B48700429F46
  1. 18
      application/Libraries/Aauth.php
  2. 4
      tests/Aauth/Libraries/Aauth/LoginTest.php

18
application/Libraries/Aauth.php

@ -938,11 +938,14 @@ class Aauth
{
if ($includeNonFlash)
{
$this->flashErrors = array_merge($this->flashErrors, $this->errors);
$this->flashErrors = array_merge($this->session->getFlashdata('errors'), $this->errors);
$this->session->setFlashdata('errors', $this->flashErrors);
}
else
{
$this->session->keepFlashdata('errors');
}
$this->flashErrors = array_merge($this->flashErrors, (array)$this->session->getFlashdata('errors'));
$this->session->setFlashdata('errors', $this->flashErrors);
}
/**
@ -1049,11 +1052,14 @@ class Aauth
if ($includeNonFlash)
{
$this->flashInfos = array_merge($this->flashInfos, $this->infos);
}
$this->flashInfos = array_merge($this->flashInfos, (array)$this->session->getFlashdata('infos'));
$this->flashInfos = array_merge($this->session->getFlashdata('infos'), $this->errors);
$this->session->setFlashdata('infos', $this->flashInfos);
}
else
{
$this->session->keepFlashdata('infos');
}
}
/**
* Get Info Array

4
tests/Aauth/Libraries/Aauth/LoginTest.php

@ -1,9 +1,11 @@
<?php namespace Tests\Aauth\Libraries\Aauth;
use Config\Aauth as AauthConfig;
use Config\App;
use Config\Logger;
use Config\Services;
use Tests\Support\Log\TestLogger;
use Tests\Support\HTTP\MockResponse;
use Tests\Support\Session\MockSession;
use CodeIgniter\Session\Handlers\FileHandler;
use CodeIgniter\Test\CIDatabaseTestCase;
@ -27,6 +29,8 @@ class LoginTest extends CIDatabaseTestCase
{
parent::setUp();
Services::injectMock('response', new MockResponse(new App()));
$this->response = service('response');
$this->library = new Aauth(null, true);
$_COOKIE = [];
$_SESSION = [];

Loading…
Cancel
Save