Skip to content

Commit

Permalink
[#14349] - Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Sep 7, 2019
1 parent 6000b5a commit ced0bb4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
18 changes: 5 additions & 13 deletions tests/unit/Flash/Direct/Helper/FlashBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@

namespace Phalcon\Test\Unit\Flash\Direct\Helper;

use Phalcon\Escaper;
use Phalcon\Flash\Direct;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use UnitTester;

class FlashBase
{
use DiTrait;

private $notImplicit = false;
private $notHtml = false;
private $classes = null;
private $escaper = null;
private $notHtml = false;
private $notImplicit = false;

private $default = [
'success' => 'successMessage',
Expand All @@ -32,11 +29,6 @@ class FlashBase
'error' => 'errorMessage',
];

public function _before(UnitTester $I)
{
$this->escaper = $this->newEscaper();
}

/**
* Tests warning (implicit flush)
*
Expand Down Expand Up @@ -65,7 +57,7 @@ public function testFlashDirectImplicitFlushHtml(UnitTester $I)
*/
private function stringTest(UnitTester $I, string $function)
{
$flash = new Direct($this->escaper);
$flash = new Direct(new Escaper());
$flash->setClasses($this->classes);

$message = 'sample message';
Expand Down Expand Up @@ -216,7 +208,7 @@ public function testFlashDirectNoImplicitFlushNoHtml(UnitTester $I)
*/
public function testFlashDirectWithAutoEscaping(UnitTester $I)
{
$flash = new Direct($this->escaper);
$flash = new Direct(new Escaper());
$flash->setClasses($this->classes);

$flash->setAutomaticHtml(false);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Flash/DirectCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ protected function getFlash()
{
$container = $this->getDi();

$flash = new Direct($this->classes);

$flash = new Direct();
$flash->setDI($container);
$flash->setClasses($this->classes);

return $flash;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Flash/Session/OutputCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public function emptyFlashSessionOutput(UnitTester $I)
protected function getFlash()
{
$container = $this->getDi();
$flash = new Session($this->classes);

$flash = new Session();
$flash->setDI($container);
$flash->setClasses($this->classes);

return $flash;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Flash/Session/SetCustomTemplateCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ protected function getFlash()
{
$container = $this->getDi();

$flash = new Session($this->classes);

$flash = new Session();
$flash->setDI($container);
$flash->setClasses($this->classes);

return $flash;
}
Expand Down

0 comments on commit ced0bb4

Please sign in to comment.