-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests skeleton and mappers interfaces fixed
- Loading branch information
s3b4stian
committed
Nov 21, 2023
1 parent
ca4f3c6
commit 3d379f9
Showing
11 changed files
with
420 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the Linna Framework. | ||
* | ||
* @author Sebastian Rapetti <sebastian.rapetti@tim.it> | ||
* @copyright (c) 2018, Sebastian Rapetti | ||
* @license http://opensource.org/licenses/MIT MIT License | ||
*/ | ||
|
||
namespace Linna\Authorization; | ||
|
||
use Linna\Storage\ExtendedPDO; | ||
use Linna\Storage\StorageFactory; | ||
use PHPUnit\Framework\TestCase; | ||
use Linna\TestHelper\Pdo\PdoOptionsFactory; | ||
|
||
class PermissionExtendedTest extends TestCase | ||
{ | ||
/** @var PermissionExtendedMapper The permission mapper */ | ||
//protected static PermissionExtendedMapper $permissionMapper; | ||
|
||
/** @var ExtendedPDO Database connection. */ | ||
//protected static ExtendedPDO $pdo; | ||
|
||
/** | ||
* Set up before class. | ||
* | ||
* @return void | ||
*/ | ||
public static function setUpBeforeClass(): void | ||
{ | ||
/*$options = [ | ||
'dsn' => $GLOBALS['pdo_mysql_dsn'], | ||
'user' => $GLOBALS['pdo_mysql_user'], | ||
'password' => $GLOBALS['pdo_mysql_password'], | ||
'options' => [ | ||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, | ||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | ||
PDO::ATTR_PERSISTENT => false, | ||
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci', | ||
], | ||
];*/ | ||
|
||
//$pdo = (new StorageFactory('pdo', PdoOptionsFactory::getOptions()))->get(); | ||
|
||
//self::$pdo = $pdo; | ||
//self::$permissionMapper = new PermissionExtendedMapper($pdo); | ||
} | ||
|
||
/** | ||
* Tear down after class. | ||
* | ||
* @return void | ||
*/ | ||
public static function tearDownAfterClass(): void | ||
{ | ||
//self::$pdo = null; | ||
//self::$permissionMapper = null; | ||
} | ||
|
||
/** | ||
* Test new role instance. | ||
* | ||
* @return void | ||
*/ | ||
public function testNewRoleInstance(): void | ||
{ | ||
//$this->assertInstanceOf(Permission::class, self::$permissionMapper->create()); | ||
} | ||
|
||
/** | ||
* Test constructor type casting. | ||
* | ||
* @return void | ||
*/ | ||
public function testConstructorTypeCasting(): void | ||
{ | ||
//$permission = self::$permissionMapper->fetchById(1); | ||
|
||
//$this->assertIsInt($permission->getId()); | ||
//$this->assertIsInt($permission->id); | ||
//$this->assertIsInt($permission->inherited); | ||
|
||
//$this->assertGreaterThan(0, $permission->getId()); | ||
//$this->assertGreaterThan(0, $permission->id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.