PHP 8.1 support by lilHermit · Pull Request #173 · cakephp/acl · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
11 changes: 4 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>

<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/>
<!-- SQLite
<env name="db_class" value="Cake\Database\Driver\Sqlite"/>
<env name="db_dsn" value="sqlite:///:memory:"/>
Expand All @@ -30,13 +31,9 @@
<directory>./tests/TestCase/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="\Cake\TestSuite\Fixture\FixtureInjector" file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
<arguments>
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
</arguments>
</listener>
</listeners>
<extensions>
<extension class="\Cake\TestSuite\Fixture\PHPUnitExtension" />
</extensions>

<filter>
<whitelist>
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Table/AclNodesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function node($ref = null)

if (empty($ref)) {
return null;
} elseif (is_int($ref) || ctype_digit($ref)) {
} elseif (is_int($ref) || (is_string($ref) && ctype_digit($ref))) {
$ref = [
'id' => $ref,
];
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Table/PermissionsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ public function getAclLink($aro, $aco)
if (empty($obj['Aro']) || empty($obj['Aco'])) {
return false;
}
$aro = $obj['Aro']->extract('id')->toArray();
$aco = $obj['Aco']->extract('id')->toArray();
$aro = $obj['Aro']->all()->extract('id')->toArray();
$aco = $obj['Aco']->all()->extract('id')->toArray();
$aro = current($aro);
$aco = current($aco);
$alias = $this->getAlias();
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/AcoActionsFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class AcoActionsFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
'model' => ['type' => 'string', 'default' => ''],
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
'alias' => ['type' => 'string', 'default' => ''],
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/AcoTwosFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class AcoTwosFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
'model' => ['type' => 'string', 'null' => true],
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
'alias' => ['type' => 'string', 'default' => ''],
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/AcosFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class AcosFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
'model' => ['type' => 'string', 'null' => true],
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
'alias' => ['type' => 'string', 'default' => ''],
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/AroTwosFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class AroTwosFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
'model' => ['type' => 'string', 'null' => true],
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
'alias' => ['type' => 'string', 'default' => ''],
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/ArosAcoTwosFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class ArosAcoTwosFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'aro_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
'aco_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
'_create' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_read' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_update' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_delete' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/ArosAcosFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class ArosAcosFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'aro_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
'aco_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
'_create' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_read' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_update' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_delete' => ['type' => 'string', 'length' => 2, 'default' => 0],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
16 changes: 0 additions & 16 deletions tests/Fixture/ArosFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
class ArosFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer'],
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
'model' => ['type' => 'string', 'null' => true],
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
'alias' => ['type' => 'string', 'default' => ''],
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];

/**
* records property
*
Expand Down
18 changes: 0 additions & 18 deletions tests/Fixture/PeopleFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@
class PeopleFixture extends TestFixture
{

/**
* fields property
*
* @var array
*/
public $fields = [
'id' => ['type' => 'integer', 'null' => false],
'name' => ['type' => 'string', 'null' => false, 'length' => 32],
'mother_id' => ['type' => 'integer', 'null' => false],
'father_id' => ['type' => 'integer', 'null' => false],
'_constraints' => [
'PRIMARY' => ['type' => 'primary', 'columns' => ['id']],
],
'_indexes' => [
'mother_id' => ['type' => 'index', 'columns' => ['mother_id', 'father_id']],
],
];

/**
* records property
*
Expand Down
19 changes: 9 additions & 10 deletions tests/TestCase/AclExtrasTest.php
Loading