Browse Source

updated Aauth/ErrorsTest.php & removed AauthTest.php

v3-dev
REJack 6 years ago
parent
commit
9601b581dc
No known key found for this signature in database
GPG Key ID: 4A44B48700429F46
  1. 4
      tests/Aauth/Libraries/Aauth/ErrorsTest.php
  2. 64
      tests/Aauth/Libraries/AauthTest.php

4
tests/Aauth/Libraries/Aauth/ErrorsTest.php

@ -66,8 +66,8 @@ class ErrorsTest extends \CIUnitTestCase
{
$session = $this->getInstance();
$this->library = new Aauth(NULL, $session);
$this->assertCount(0, $this->session->errors);
$this->assertCount(0, $this->session->get('errors'));
$this->library->error('test message 1', true);
$this->assertCount(1, $this->session->errors);
$this->assertCount(1, $this->session->get('errors'));
}
}

64
tests/Aauth/Libraries/AauthTest.php

@ -1,64 +0,0 @@
<?php namespace Tests\Aauth\Libraries;
use Config\Logger;
use Config\Services;
use Tests\Support\Log\TestLogger;
use Tests\Support\Session\MockSession;
use CodeIgniter\Session\Handlers\FileHandler;
use App\Libraries\Aauth;
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/
class AauthTest extends \CIUnitTestCase
{
public function setUp()
{
parent::setUp();
$_COOKIE = [];
$_SESSION = [];
}
public function tearDown()
{
}
protected function getInstance($options=[])
{
$defaults = [
'sessionDriver' => 'CodeIgniter\Session\Handlers\FileHandler',
'sessionCookieName' => 'ci_session',
'sessionExpiration' => 7200,
'sessionSavePath' => 'null',
'sessionMatchIP' => false,
'sessionTimeToUpdate' => 300,
'sessionRegenerateDestroy' => false,
'cookieDomain' => '',
'cookiePrefix' => '',
'cookiePath' => '/',
'cookieSecure' => false,
];
$config = (object)$defaults;
$session = new MockSession(new FileHandler($config, Services::request()->getIPAddress()), $config);
$session->setLogger(new TestLogger(new Logger()));
$session->start();
return $session;
}
//--------------------------------------------------------------------
public function testIsLoggedIn()
{
$session = $this->getInstance();
$this->library = new Aauth(NULL, $session);
$this->assertFalse($this->library->isLoggedIn());
}
}
Loading…
Cancel
Save