Skip to content

Commit

Permalink
add permission copy test to unit test
Browse files Browse the repository at this point in the history
typo in iplist test
  • Loading branch information
stefan committed Oct 4, 2024
1 parent 72f959f commit 5349303
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/testcases/ips/ipListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testGetIpAll()
$data = $this->object->getIpAll();
$count = count($data);
if ($count == 0) {
$this->markTestSkipped('No wordband items available in db');
$this->markTestSkipped('No ip items available in db');
}

$this->assertTrue(is_array($data));
Expand Down
8 changes: 8 additions & 0 deletions tests/testcases/users/userRollTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public function testCopy()
$this->assertTrue($copy->exists());
$this->assertStringContainsString('Kopie von', $copy->getRollNameTranslated());
$this->assertTrue($copy->getCodex() === $object->getCodex());

$permOld = new \fpcm\model\permissions\permissions($this->object->getId());
$permCopy = new \fpcm\model\permissions\permissions($copy->getId());

$expected = hash('sha256', json_encode($permOld->getPermissionData()));
$actual = hash('sha256', json_encode($permCopy->getPermissionData()));

$this->assertEquals($expected, $actual);
$this->assertTrue($copy->delete());
}

Expand Down

0 comments on commit 5349303

Please sign in to comment.