Skip to content

Commit

Permalink
[#13648] - Reformatted test- refactor with dataProviders
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed May 15, 2019
1 parent 50526ab commit e0c76cf
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 168 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@
"Zephir\\Optimizers\\": "optimizers/",
"Phalcon\\Test\\Unit\\": "tests/unit/",
"Phalcon\\Test\\Integration\\": "tests/integration/",
"Phalcon\\Test\\Controllers\\": "tests/_data/fixtures/controllers/",
"Phalcon\\Test\\Fixtures\\": "tests/_data/fixtures/",
"Phalcon\\Test\\Module\\": "tests/_support/Module/",
"Phalcon\\Test\\Models\\": "tests/_data/fixtures/models/",
"Phalcon\\Test\\Listener\\": "tests/_data/listener/",
"Phalcon\\Test\\Db\\": "tests/_data/db/"
}
Expand Down
13 changes: 7 additions & 6 deletions tests/unit/Firewall/Adapter/Annotations/AnnotationsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Phalcon\Test\Unit\Firewall\Adapter\Annotations;

use function getOptionsModelCacheStream;
use Phalcon\Annotations\Adapter\Memory;
use Phalcon\Cache\Adapter\Memory;
use Phalcon\Cache\Adapter\Stream as StorageStream;
use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Annotations;
Expand Down Expand Up @@ -44,6 +44,9 @@ public function _before()
$this->setNewFactoryDefault();
$this->setDiMysql();

$serializer = new SerializerFactory();
$cache = new Memory($serializer);

$dispatcher = new Dispatcher();
$dispatcher->setDefaultNamespace(
'Phalcon\Test\Controllers\Firewall'
Expand All @@ -56,7 +59,7 @@ function () {
return false;
}
);
$firewall = new Annotations(new Memory());
$firewall = new Annotations($cache);
$firewall->setEventsManager($eventsManager)
->setRoleCallback(
function ($di) {
Expand Down Expand Up @@ -502,9 +505,7 @@ public function testBeforeExecute(UnitTester $I)
public function testCache(UnitTester $I)
{
$serializer = new SerializerFactory();
$cache = new StorageStream($serializer, getOptionsModelCacheStream());

$this->firewall->setCache($cache);
$cache = new Memory($serializer);

$di = $this->container;
$eventsManager = new Manager();
Expand All @@ -514,7 +515,7 @@ function () {
return false;
}
);
$firewall = new Annotations(new Memory());
$firewall = new Annotations($cache);
$firewall->setEventsManager($eventsManager)
->setRoleCallback(
function ($di) {
Expand Down
Loading

0 comments on commit e0c76cf

Please sign in to comment.