Skip to content

Commit

Permalink
Added some tests that cover the ctype_digit condition
Browse files Browse the repository at this point in the history
  • Loading branch information
lilHermit committed Aug 29, 2022
1 parent 4db5bf5 commit a8704f0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/TestCase/Model/Table/AclNodesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,41 @@ public function testNode()
$expected = [8, 7, 6, 1];
$this->assertSame($expected, $result);

$result = $Aco->node("8");
$result = $result->all()->extract('id')->toArray();
$expected = [8, 7, 6, 1];
$this->assertSame($expected, $result);

$result = $Aco->node(7);
$result = $result->all()->extract('id')->toArray();
$expected = [7, 6, 1];
$this->assertSame($expected, $result);

$result = $Aco->node("7");
$result = $result->all()->extract('id')->toArray();
$expected = [7, 6, 1];
$this->assertSame($expected, $result);

$result = $Aco->node(4);
$result = $result->all()->extract('id')->toArray();
$expected = [4, 3, 2, 1];
$this->assertSame($expected, $result);

$result = $Aco->node("4");
$result = $result->all()->extract('id')->toArray();
$expected = [4, 3, 2, 1];
$this->assertSame($expected, $result);

$result = $Aco->node(3);
$result = $result->all()->extract('id')->toArray();
$expected = [3, 2, 1];
$this->assertSame($expected, $result);

$result = $Aco->node("3");
$result = $result->all()->extract('id')->toArray();
$expected = [3, 2, 1];
$this->assertSame($expected, $result);

$this->assertFalse($Aco->node('Controller2/action3'));

$this->assertFalse($Aco->node('Controller2/action3/record5'));
Expand Down

0 comments on commit a8704f0

Please sign in to comment.