Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Apr 29, 2023
1 parent efcb998 commit 33fc81f
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 22 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -3,14 +3,29 @@ on:
- pull_request
- push
jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none
- name: Composer install
run: composer install --no-interaction --no-ansi --no-progress
- name: Run Psalm
run: vendor/bin/psalm --no-progress --show-info=false
phpunit:
name: "PHPUnit (PHP: ${{ matrix.php-versions }})"
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- 8.0
- 8.1
- 8.2
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -6,6 +6,6 @@ services. You can install the adapter with the following steps inside your Fusio
project:

composer require fusio/adapter-openstack
php bin/fusio system:register Fusio\Adapter\OpenStack\Adapter
php bin/fusio system:register "Fusio\Adapter\OpenStack\Adapter"

[Fusio]: http://fusio-project.org/
[Fusio]: https://www.fusio-project.org/
7 changes: 4 additions & 3 deletions composer.json
Expand Up @@ -12,12 +12,13 @@
}
],
"require": {
"php": ">=8.0",
"fusio/engine": "^5.0",
"php": ">=8.1",
"fusio/engine": "^6.0",
"php-opencloud/openstack": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0"
"phpunit/phpunit": "^9.0",
"vimeo/psalm": "^5.9"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 0 additions & 10 deletions definition.json

This file was deleted.

16 changes: 16 additions & 0 deletions psalm.xml
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
20 changes: 20 additions & 0 deletions resources/container.php
@@ -0,0 +1,20 @@
<?php

use Fusio\Adapter\OpenStack\Connection\BlockStorage;
use Fusio\Adapter\OpenStack\Connection\Compute;
use Fusio\Adapter\OpenStack\Connection\Identity;
use Fusio\Adapter\OpenStack\Connection\Images;
use Fusio\Adapter\OpenStack\Connection\Networking;
use Fusio\Adapter\OpenStack\Connection\ObjectStore;
use Fusio\Engine\Adapter\ServiceBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $container) {
$services = ServiceBuilder::build($container);
$services->set(BlockStorage::class);
$services->set(Compute::class);
$services->set(Identity::class);
$services->set(Images::class);
$services->set(Networking::class);
$services->set(ObjectStore::class);
};
2 changes: 1 addition & 1 deletion src/Adapter.php
Expand Up @@ -32,7 +32,7 @@
*/
class Adapter implements AdapterInterface
{
public function getDefinition(): string
public function getContainerFile(): string
{
return __DIR__ . '/../definition.json';
}
Expand Down
7 changes: 2 additions & 5 deletions tests/Connection/ApiTestCase.php
Expand Up @@ -21,11 +21,10 @@

namespace Fusio\Adapter\OpenStack\Tests\Connection;

use Fusio\Adapter\Neo4j\Tests\OpenStackTestCase;
use Fusio\Adapter\OpenStack\Connection\ConnectionAbstract;
use Fusio\Engine\Parameters;
use Fusio\Engine\Test\EngineTestCaseTrait;
use GuzzleHttp\Client;
use PHPUnit\Framework\TestCase;

/**
* ApiTestCase
Expand All @@ -34,10 +33,8 @@
* @license http://www.gnu.org/licenses/agpl-3.0
* @link https://www.fusio-project.org/
*/
abstract class ApiTestCase extends TestCase
abstract class ApiTestCase extends OpenStackTestCase
{
use EngineTestCaseTrait;

protected function getConnection($class)
{
/** @var ConnectionAbstract $connectionFactory */
Expand Down
55 changes: 55 additions & 0 deletions tests/OpenStackTestCase.php
@@ -0,0 +1,55 @@
<?php
/*
* Fusio
* A web-application to create dynamically RESTful APIs
*
* Copyright (C) 2015-2022 Christoph Kappestein <christoph.kappestein@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Fusio\Adapter\Neo4j\Tests;

use Fusio\Adapter\OpenStack\Connection\BlockStorage;
use Fusio\Adapter\OpenStack\Connection\Compute;
use Fusio\Adapter\OpenStack\Connection\Identity;
use Fusio\Adapter\OpenStack\Connection\Images;
use Fusio\Adapter\OpenStack\Connection\Networking;
use Fusio\Adapter\OpenStack\Connection\ObjectStore;
use Fusio\Engine\Action\Runtime;
use Fusio\Engine\Test\EngineTestCaseTrait;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;

/**
* OpenStackTestCase
*
* @author Christoph Kappestein <christoph.kappestein@gmail.com>
* @license http://www.gnu.org/licenses/agpl-3.0
* @link https://www.fusio-project.org/
*/
abstract class OpenStackTestCase extends TestCase
{
use EngineTestCaseTrait;

protected function configure(Runtime $runtime, Container $container): void
{
$container->set(BlockStorage::class, new BlockStorage());
$container->set(Compute::class, new Compute());
$container->set(Identity::class, new Identity());
$container->set(Images::class, new Images());
$container->set(Networking::class, new Networking());
$container->set(ObjectStore::class, new ObjectStore());
}
}

0 comments on commit 33fc81f

Please sign in to comment.