Browse Source

updated Aauth/ErrorsTest.php

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

22
tests/Aauth/Libraries/Aauth/ErrorsTest.php

@ -69,7 +69,7 @@ class ErrorsTest extends \CIUnitTestCase
$this->assertEquals(['test message 1','test message 2'], $this->library->getErrorsArray()); $this->assertEquals(['test message 1','test message 2'], $this->library->getErrorsArray());
} }
public function testPrintErrors() public function testPrintErrorsReturn()
{ {
$this->library = new Aauth(NULL, TRUE); $this->library = new Aauth(NULL, TRUE);
$this->library->error('test message 1'); $this->library->error('test message 1');
@ -78,6 +78,14 @@ class ErrorsTest extends \CIUnitTestCase
$this->assertEquals('test message 1<br />test message 2', $this->library->printErrors('<br />', true)); $this->assertEquals('test message 1<br />test message 2', $this->library->printErrors('<br />', true));
} }
public function testPrintErrorsEcho()
{
$this->library = new Aauth(NULL, TRUE);
$this->library->error('test message 1');
$this->library->printErrors('<br />');
$this->expectOutputString('test message 1');
}
public function testClearErrors() public function testClearErrors()
{ {
$session = $this->getInstance(); $session = $this->getInstance();
@ -88,18 +96,6 @@ class ErrorsTest extends \CIUnitTestCase
$this->assertNull($session->get('errors')); $this->assertNull($session->get('errors'));
} }
public function testKeepErrorsInclude()
{
$session = $this->getInstance();
$this->library = new Aauth(NULL, $session);
$this->library->error('test message 1 nonFlash');
$this->assertNull($session->get('errors'));
$this->library->error('test message 1 Flash', true);
$this->assertEquals(['test message 1 Flash'], $session->get('errors'));
$this->library->keepErrors(true);
$this->assertEquals(['test message 1 Flash', 'test message 1 nonFlash'], $session->get('errors'));
}
public function testErrorsFlash() public function testErrorsFlash()
{ {
$session = $this->getInstance(); $session = $this->getInstance();

Loading…
Cancel
Save