Skip to content

Commit

Permalink
[#13648] - Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed May 15, 2019
1 parent d0d5b4e commit 99d9838
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@

namespace Phalcon\Test\Unit\Firewall\Adapter\Micro\Acl;

use Phalcon\Acl as PhAcl;
use Phalcon\Firewall\Adapter\Micro\Acl;
use UnitTester;

class GetDefaultAccessCest
class GetSetDefaultAccessCest
{
/**
* Tests Phalcon\Firewall\Adapter\Micro\Acl :: getDefaultAccess()
* Tests Phalcon\Firewall\Adapter\Micro\Acl :: getDefaultAccess()/setDefaultAccess()
*
* @author Phalcon Team <[email protected]>
* @since 2019-05-12
*/
public function firewallAdapterMicroAclGetDefaultAccess(UnitTester $I)
public function firewallAdapterMicroAclGetSetDefaultAccess(UnitTester $I)
{
$I->wantToTest('Firewall\Adapter\Micro\Acl - getDefaultAccess()');
$I->wantToTest('Firewall\Adapter\Micro\Acl - getDefaultAccess()/setDefaultAccess()');

$I->skipTest('Need implementation');
$firewall = new Acl('acl');
$firewall->setDefaultAccess(PhAcl::ALLOW);

$actual = $firewall->getDefaultAccess();
$I->assertEquals(PhAcl::ALLOW, $actual);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@

namespace Phalcon\Test\Unit\Firewall\Adapter\Micro\Acl;

use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Micro\Acl;
use UnitTester;

class GetEventsManagerCest
class GetSetEventsManagerCest
{
/**
* Tests Phalcon\Firewall\Adapter\Micro\Acl :: getEventsManager()
* Tests Phalcon\Firewall\Adapter\Micro\Acl :: getEventsManager()/setEventsManager()
*
* @author Phalcon Team <[email protected]>
* @since 2019-05-12
*/
public function firewallAdapterMicroAclGetEventsManager(UnitTester $I)
public function firewallAdapterMicroAclGetSetEventsManager(UnitTester $I)
{
$I->wantToTest('Firewall\Adapter\Micro\Acl - getEventsManager()');
$I->wantToTest('Firewall\Adapter\Micro\Acl - getEventsManager()/setEventsManager()');

$I->skipTest('Need implementation');
$firewall = new Acl('acl');
$eventsManager = new Manager();

$firewall->setEventsManager($eventsManager);

$actual = $firewall->getEventsManager();
$I->assertEquals($eventsManager, $actual);
}
}
6 changes: 6 additions & 0 deletions tests/unit/Firewall/Adapter/Micro/Acl/SetCacheCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Fixtures\Traits\FirewallTrait;
use Phalcon\Test\Models\AlbumORama\Albums;
use function sleep;
use UnitTester;

class SetCacheCest
Expand Down Expand Up @@ -173,6 +174,11 @@ function (BindingRole $user) {
);
$I->assertEquals($returnedValue, $example[2]);
$I->assertEquals($cache->get('_PHF_')[$example[3]], $example[4]);

/**
* Hack to remove the too many connections
*/
sleep(1);
}

/**
Expand Down
31 changes: 0 additions & 31 deletions tests/unit/Firewall/Adapter/Micro/Acl/SetDefaultAccessCest.php

This file was deleted.

31 changes: 0 additions & 31 deletions tests/unit/Firewall/Adapter/Micro/Acl/SetEventsManagerCest.php

This file was deleted.

0 comments on commit 99d9838

Please sign in to comment.