From e712bec6e5f8ab519b75a61c615d0689d8d9423e Mon Sep 17 00:00:00 2001 From: REJack Date: Fri, 7 Dec 2018 10:49:31 +0100 Subject: [PATCH] updated Aauth/ErrorsTest.php --- tests/Aauth/Libraries/Aauth/ErrorsTest.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/Aauth/Libraries/Aauth/ErrorsTest.php b/tests/Aauth/Libraries/Aauth/ErrorsTest.php index f7b628a..63cd029 100644 --- a/tests/Aauth/Libraries/Aauth/ErrorsTest.php +++ b/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()); } - public function testPrintErrors() + public function testPrintErrorsReturn() { $this->library = new Aauth(NULL, TRUE); $this->library->error('test message 1'); @@ -78,6 +78,14 @@ class ErrorsTest extends \CIUnitTestCase $this->assertEquals('test message 1
test message 2', $this->library->printErrors('
', true)); } + public function testPrintErrorsEcho() + { + $this->library = new Aauth(NULL, TRUE); + $this->library->error('test message 1'); + $this->library->printErrors('
'); + $this->expectOutputString('test message 1'); + } + public function testClearErrors() { $session = $this->getInstance(); @@ -88,18 +96,6 @@ class ErrorsTest extends \CIUnitTestCase $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() { $session = $this->getInstance();