Skip to content

Commit

Permalink
Miscellaneous fixes (#69)
Browse files Browse the repository at this point in the history
* Actualize badges
* Update README.md
  • Loading branch information
arogachev committed Feb 18, 2024
1 parent 8b775e3 commit 5f3f873
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
18 changes: 14 additions & 4 deletions README.md
Expand Up @@ -12,10 +12,20 @@ The package provides [Yii Database](https://github.com/yiisoft/db) storage for
[![Latest Stable Version](https://poser.pugx.org/yiisoft/rbac-db/v/stable.png)](https://packagist.org/packages/yiisoft/rbac-db)
[![Total Downloads](https://poser.pugx.org/yiisoft/rbac-db/downloads.png)](https://packagist.org/packages/yiisoft/rbac-db)
[![Build status](https://github.com/yiisoft/rbac-db/workflows/build/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3Abuild)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiisoft/rbac-db/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/rbac-db/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/rbac-db/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/rbac-db/?branch=master)
[![codecov](https://codecov.io/gh/yiisoft/rbac-db/graph/badge.svg?token=YU8LVBNCQ8)](https://codecov.io/gh/yiisoft/rbac-db)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Frbac-db%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/rbac-db/master)
[![static analysis](https://github.com/yiisoft/rbac-db/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3A%22static+analysis%22)
[![type-coverage](https://shepherd.dev/github/yiisoft/rbac-db/coverage.svg)](https://shepherd.dev/github/yiisoft/rbac-db)

Detailed build statuses:

| RDBMS | Status |
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| SQLite | [![SQLite status](https://github.com/yiisoft/rbac-db/workflows/sqlite/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3Asqlite) |
| MySQL | [![MYSQL status](https://github.com/yiisoft/rbac-db/workflows/mysql/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3Amysql) |
| PostgreSQL | [![MYSQL status](https://github.com/yiisoft/rbac-db/workflows/pgsql/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3Apgsql) |
| Microsoft SQL Server | [![MYSQL status](https://github.com/yiisoft/rbac-db/workflows/mssql/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3Amssql) |
| Oracle | [![MYSQL status](https://github.com/yiisoft/rbac-db/workflows/oracle/badge.svg)](https://github.com/yiisoft/rbac-db/actions?query=workflow%3Aoracle) |

## Requirements

Expand Down Expand Up @@ -90,8 +100,8 @@ When using [Yii Console](https://github.com/yiisoft/yii-console), add this to `c
'yiisoft/db-migration' => [
// ...
'sourcePaths' => [
implode(DIRECTORY_SEPARATOR, [dirname(__DIR__), 'vendor', 'yiisoft', 'rbac', 'migrations', 'items']),
implode(DIRECTORY_SEPARATOR, [dirname(__DIR__), 'vendor', 'yiisoft', 'rbac', 'migrations', 'assignments']),
dirname(__DIR__) . '/vendor/yiisoft/rbac-db/migrations/items']),
dirname(__DIR__) . '/vendor/yiisoft/rbac-db/migrations/assignments']),
],
],
```
Expand Down
22 changes: 7 additions & 15 deletions tests/Base/ManagerTest.php
Expand Up @@ -7,15 +7,14 @@
use Yiisoft\Rbac\AssignmentsStorageInterface;
use Yiisoft\Rbac\Db\TransactionalManagerDecorator;
use Yiisoft\Rbac\ItemsStorageInterface;
use Yiisoft\Rbac\Manager;
use Yiisoft\Rbac\ManagerInterface;
use Yiisoft\Rbac\RuleFactoryInterface;
use Yiisoft\Rbac\Tests\Common\ManagerConfigurationTestTrait;
use Yiisoft\Rbac\Tests\Support\SimpleRuleFactory;

abstract class ManagerTest extends TestCase
{
use ManagerConfigurationTestTrait;
use ManagerConfigurationTestTrait {
createManager as protected traitCreateManager;
}

protected function tearDown(): void
{
Expand All @@ -33,18 +32,11 @@ protected function populateDatabase(): void
protected function createManager(
?ItemsStorageInterface $itemsStorage = null,
?AssignmentsStorageInterface $assignmentsStorage = null,
?RuleFactoryInterface $ruleFactory = null,
?bool $enableDirectPermissions = false
): ManagerInterface {
$arguments = [
$itemsStorage ?? $this->createItemsStorage(),
$assignmentsStorage ?? $this->createAssignmentsStorage(),
$ruleFactory ?? new SimpleRuleFactory(),
];
if ($enableDirectPermissions !== null) {
$arguments[] = $enableDirectPermissions;
}

return new TransactionalManagerDecorator(new Manager(...$arguments), $this->getDatabase());
return new TransactionalManagerDecorator(
$this->traitCreateManager($itemsStorage, $assignmentsStorage, $enableDirectPermissions),
$this->getDatabase(),
);
}
}

0 comments on commit 5f3f873

Please sign in to comment.