Commit 29ff8abf authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Mise en place d'un environnement de test fonctionnel.

parent eaa8ae34
No related merge requests found
Showing with 231 additions and 19 deletions
+231 -19
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "1e0467c51de02005959c440adc3d707b", "content-hash": "356059e4d5a173d2e481ebf5636f796e",
"packages": [ "packages": [
{ {
"name": "api-platform/core", "name": "api-platform/core",
...@@ -2188,16 +2188,16 @@ ...@@ -2188,16 +2188,16 @@
}, },
{ {
"name": "doctrine/persistence", "name": "doctrine/persistence",
"version": "v1.1.0", "version": "1.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/persistence.git", "url": "https://github.com/doctrine/persistence.git",
"reference": "c0f1c17602afc18b4cbd8e1c8125f264c9cf7d38" "reference": "3da7c9d125591ca83944f477e65ed3d7b4617c48"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/persistence/zipball/c0f1c17602afc18b4cbd8e1c8125f264c9cf7d38", "url": "https://api.github.com/repos/doctrine/persistence/zipball/3da7c9d125591ca83944f477e65ed3d7b4617c48",
"reference": "c0f1c17602afc18b4cbd8e1c8125f264c9cf7d38", "reference": "3da7c9d125591ca83944f477e65ed3d7b4617c48",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2266,7 +2266,7 @@ ...@@ -2266,7 +2266,7 @@
"orm", "orm",
"persistence" "persistence"
], ],
"time": "2018-11-21T00:33:13+00:00" "time": "2019-04-23T08:28:24+00:00"
}, },
{ {
"name": "doctrine/reflection", "name": "doctrine/reflection",
...@@ -4628,16 +4628,16 @@ ...@@ -4628,16 +4628,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "7.5.8", "version": "7.5.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c29c0525cf4572c11efe1db49a8b8aee9dfac58a" "reference": "134669cf0eeac3f79bc7f0c793efbc158bffc160"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c29c0525cf4572c11efe1db49a8b8aee9dfac58a", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/134669cf0eeac3f79bc7f0c793efbc158bffc160",
"reference": "c29c0525cf4572c11efe1db49a8b8aee9dfac58a", "reference": "134669cf0eeac3f79bc7f0c793efbc158bffc160",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -4708,7 +4708,7 @@ ...@@ -4708,7 +4708,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2019-03-26T13:23:54+00:00" "time": "2019-04-19T15:50:46+00:00"
}, },
{ {
"name": "psr/simple-cache", "name": "psr/simple-cache",
...@@ -4764,12 +4764,12 @@ ...@@ -4764,12 +4764,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git", "url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "9c6c45a2bf8825209fc18861ff666a90f4d878cf" "reference": "7c567855e40e04d17e2b91f3fd1d8f6baf5bcca6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9c6c45a2bf8825209fc18861ff666a90f4d878cf", "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/7c567855e40e04d17e2b91f3fd1d8f6baf5bcca6",
"reference": "9c6c45a2bf8825209fc18861ff666a90f4d878cf", "reference": "7c567855e40e04d17e2b91f3fd1d8f6baf5bcca6",
"shasum": "" "shasum": ""
}, },
"conflict": { "conflict": {
...@@ -4868,7 +4868,7 @@ ...@@ -4868,7 +4868,7 @@
"silverstripe/userforms": "<3", "silverstripe/userforms": "<3",
"simple-updates/phpwhois": "<=1", "simple-updates/phpwhois": "<=1",
"simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4",
"simplesamlphp/simplesamlphp": "<1.16.3", "simplesamlphp/simplesamlphp": "<1.15.2|>=1.16,<1.16.3",
"simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
"slim/slim": "<2.6", "slim/slim": "<2.6",
"smarty/smarty": "<3.1.33", "smarty/smarty": "<3.1.33",
...@@ -4902,7 +4902,7 @@ ...@@ -4902,7 +4902,7 @@
"symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"tecnickcom/tcpdf": "<6.2.22", "tecnickcom/tcpdf": "<6.2.22",
"thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/backoffice-default-template": ">=2.1,<2.1.2",
"thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2",
"theonedemon/phpwhois": "<=4.2.5", "theonedemon/phpwhois": "<=4.2.5",
"titon/framework": ">=0,<9.9.99", "titon/framework": ">=0,<9.9.99",
"truckersmp/phpwhois": "<=4.3.1", "truckersmp/phpwhois": "<=4.3.1",
...@@ -4961,7 +4961,7 @@ ...@@ -4961,7 +4961,7 @@
} }
], ],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2019-04-18T06:59:35+00:00" "time": "2019-04-20T06:58:11+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
...@@ -6599,6 +6599,81 @@ ...@@ -6599,6 +6599,81 @@
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-01-16T20:31:39+00:00" "time": "2019-01-16T20:31:39+00:00"
}, },
{
"name": "symfony/translation",
"version": "v4.2.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "46c0dede1f925383d13dc783857be2c41efd0b24"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/46c0dede1f925383d13dc783857be2c41efd0b24",
"reference": "46c0dede1f925383d13dc783857be2c41efd0b24",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/contracts": "^1.0.2",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/config": "<3.4",
"symfony/dependency-injection": "<3.4",
"symfony/yaml": "<3.4"
},
"provide": {
"symfony/translation-contracts-implementation": "1.0"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0",
"symfony/http-kernel": "~3.4|~4.0",
"symfony/intl": "~3.4|~4.0",
"symfony/var-dumper": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"psr/log-implementation": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2019-04-10T16:20:36+00:00"
},
{ {
"name": "symfony/validator", "name": "symfony/validator",
"version": "v4.2.7", "version": "v4.2.7",
......
<?php declare(strict_types=1);
/**
* Copyright (C) 2019 IRSTEA
* All rights reserved.
*
* @copyright 2019 IRSTEA
* @author guillaume.perreal
*/
namespace Irstea\ApiMetadata\Bridge\Symfony\Bundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class ApiMetadataBundle
*/
class ApiMetadataBundle extends Bundle
{
}
/var
<?php declare(strict_types=1);
/**
* Copyright (C) 2019 IRSTEA
* All rights reserved.
*
* @copyright 2019 IRSTEA
* @author guillaume.perreal
*/
namespace Irstea\ApiMetadata\Tests\Fixtures;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class TestBundle
*/
class TestBundle extends Bundle
{
}
<?php declare(strict_types=1);
/**
* Copyright (C) 2019 IRSTEA
* All rights reserved.
*
* @copyright 2019 IRSTEA
* @author guillaume.perreal
*/
namespace Irstea\ApiMetadata\Tests\Fixtures;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Irstea\ApiMetadata\Bridge\Symfony\Bundle\ApiMetadataBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
/**
* Class TestKernel
*/
class TestKernel extends Kernel
{
use MicroKernelTrait;
/**
* {@inheritDoc}
*/
public function registerBundles()
{
return [
new FrameworkBundle(),
new DoctrineBundle(),
new ApiMetadataBundle(),
new TestBundle()
];
}
/**
* {@inheritDoc}
*/
protected function configureRoutes(RouteCollectionBuilder $routes)
{
// NOOP
}
/**
* {@inheritDoc}
*/
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
{
$c->loadFromExtension('framework', [
'secret' => __DIR__,
'test' => null,
]);
}
/**
* {@inheritDoc}
*/
public function getProjectDir(): string
{
return __DIR__;
}
}
...@@ -24,8 +24,6 @@ date_default_timezone_set('UTC'); ...@@ -24,8 +24,6 @@ date_default_timezone_set('UTC');
$loader = require __DIR__ . '/../vendor/autoload.php'; $loader = require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/Fixtures/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']); AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader; return $loader;
tests/console 0 → 100755
#!/usr/bin/env php
<?php declare(strict_types=1);
use Irstea\ApiMetadata\Tests\Fixtures\TestKernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Debug\ErrorHandler;
set_time_limit(0);
require __DIR__ . '/bootstrap.php';
umask(0000);
/** @noinspection ForgottenDebugOutputInspection */
Debug::enable();
/** @noinspection ForgottenDebugOutputInspection */
ErrorHandler::register();
$kernel = new TestKernel('dev', true);
$application = new Application($kernel);
$application->run();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment